-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rust-native audio transcoding #317
Rust-native audio transcoding #317
Conversation
…io sound graph files
Just played with the
I will now try to fix it on top of your code. It seems that the
The real cause is When I enable all default features in
which is very strange... well, you need to use "pcm" feature rather than "wav" for Even so, I still got an error.
Right, three features have to be enabled: ["wav", "pcm", "mp3"] (not very intuitive but I will pr them later...) I got the same error when all features are enabled:
[2023-04-17T08:35:07Z ERROR ambient_build] In pipeline pipeline.json/1, at file bonk.wav
|
Hi, It looks that We can use |
I would be interested in doing the switch, but symphonia is very close to being fully working. Would the minimp3 or hound crates provide any features that symphonia wouldn't? Symphonia supports other audio codecs like FLAC and AAC, and adding support to those with symphonia is as simple as enabling the feature flag and matching the audio asset pipeline with the corresponding file extensions. It seems like now that .wav files are being processed correctly, the problem is that the bits in the channel flags are counted to set the channel count in the Vorbis encoder. This doesn't produce the correct number of channels in all cases. This can be fixed if I use a more comprehensive method of querying which channel bits are set instead, and I'll be sure to cover more testcases with the test input files. |
For extra featues, probably not. But I do have |
Yeah, I've ran |
I made a mistake with the channel count; counting the bits WAS the correct way to do that, but I confused the After enabling the |
Cool, I will test this ASAP |
Sounds good to me - the log hiding is done at the top-level here: Lines 28 to 40 in 40eb6eb
We can just add a commit to this PR to do that, and merge (Marceline won't be online until later) - are you OK to do that? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The latest version works perfectly on my Mac. During the conversion, some unnecessary logs are printed, but I guess it's harder to remove as this comes from the symphonia itself. We can work on the conversion mechanism later: #320
[2023-04-19T08:21:42Z INFO symphonia_core::probe] found the format marker [49, 44, 33] @ 0+2 bytes.
[2023-04-19T08:21:42Z INFO symphonia_core::probe] found the format marker [ff, fb] @ 1246+2 bytes.
[2023-04-19T08:21:42Z INFO symphonia_bundle_mp3::demuxer] using xing header for duration```
Yes |
…coding Rust-native audio transcoding
Closes #38.
Regrettably, there are no pure-Rust ogg Vorbis encoding crates right now. However, I've added the next best thing: vorbis_rs. It has active maintainers and uses the latest ogg libraries. The other Rust ogg libraries are unmaintained and use older versions of libogg and libvorbis with known security vulnerabilities.
I also caught an issue where sound graph files were using the string literal
"SOUND_GRAPH_EXTENSION"
instead of the constant valueSOUND_GRAPH_EXTENSION
, so I've patched that.Also, I haven't implemented the copying of tags from the input file to the output file. The reason is that
vorbis_rs
expects tag values to be strings but symphonia tag values can be lots of different types. I'm not sure what to do about this, so I've left tags empty in the output file for now.