Pregunta

I'm writing a real-time audio application that runs a stream in exclusive mode. In order to properly present data to the device, it needs to arrive in a format that isn't of my own choosing. All of my audio processing is done with floating point samples before being sent to the device, and the device's wave format might not be (and probably isn't) set to WAVE_FORMAT_IEEE_FLOAT - for example, it might be WAVE_FORMAT_EXTENSIBLE or WAVE_FORMAT_PCM.

Is there an API that makes it easy to convert between one wave format (floating point) and another (the device's format)?

¿Fue útil?

Solución

Use an Audio Compression Manager (ACM) conversion stream:

Converting Data from One Format to Another

If you cannot create a single stream from your format to the device's format, you will have to create two streams - one from your format to WAVE_FORMAT_PCM, and the other from WAVE_FORMAT_PCM to the device's format (all streams/devices have to support conversions to/from PCM).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top