ipatix/agbplay

[Feature Request] Add option to emit PCM wav file (non-floats)

Closed this issue · 6 comments

Emitted files can't just be handed over to OpenAL unless using OpenAL-soft with float32 extension because they are stored as float32. I didn't see any option to store it as normal PCM.

Although I'd agree it'd be helpful to have adjustable output format, the output wav files are currently only intended as intermediate files. For normal use they are undoubtedly huge and have an overkill of precision.

My usual procedure is to convert the output files with programs like Audacity or SoX (be careful that SoX will clamp the float files to +/-1.0) to get the files that I actually want.

I'm not sure what the exact issue is with OpenAL, but for the meantime I'd just convert the files from float32 to 16 bit integer or something. Btw, just as a clarification: float wav files are still PCM. Main difference to standard wav files is the number encoding to something more common like 16 bit integer, but so far I haven't really came across a lot of software that does not support float wav files.

Feel free to reopen the issue if it's a request for adjustable output formats, but don't expect it to get high priority to be implemented.

I can't reopen, but yeah adjustable output formats would be really nice to have. I use MediaHuman Audio Converter to do the batch conversion of said files. Fast, quick, and supports most everything I can find.

Audacity doesn't appear to do such batching or else I would be using that.

You are right. I am looking for 8 or 16 bit PCM. Without extensions and perhaps openal-soft (eww no hardware accel) there isn't any way to use it without converting first. Quite frankly I would rather your hands convert the float32 to int16. I am not sure if float32 is normalized (0.0-1.0) floats, and if there is any rounding (0.51*65536=33,423.36) someone responsible should take care of it.

May I ask why you want to load sounds in OpenAL Soft? To me that seems that you need the files in a format suitable for playback and in this case I wonder why you don't want to use a compressed format.

I will use OpenAL any day instead of fishy audio libraries like portaudio

So you are writing a program? Although I'd generally agree that having output format options is nice I personally find that it's up to you to convert it to whatever your software needs.

Btw, OpenAL and portaudio are quite different in terms of what they allow you to do. OpenAL is really useful for making games with 3d audio and portaudio is much more low level by just providing an abstraction over various host APIs so you can stream audio buffers to your speakers without any processing.

Btw, Audacity can in fact do batch processing. Have a look at "Edit Chains" and "Apply Chain" in the file menu.