[EMAIL PROTECTED] wrote:
Hi All,
I'm looking into resampling of audio and have few questions. Can somebody
help me in understanding what are the capabilities of the Helix audio
resampling ?
Will audio system resample based on device's capabilities ?
For E.g.. If a clip's sampling rate is 32KHz and if device does not support
32KHz, will the samples be resampled ?
I noticed an array z_anValidSampleRates in hxaudsess.cpp. Are these the
sampling rates supported ? I tried removing a sampling rate from this array and
tried to play a clip of the same removed sampling rate, expecting the audio
device to be opened on resampled rate, but audio device was opened on the
clip's sample rate.
And also the code on CHXAudioSession::GetDeviceFormat() (hxaudsess.cpp) creates a table of
supported combination of sample rates and channels for the device. The tables first entry is always
the clips exact properties except when "AudioDeviceSamplesPerSec" is added to the config
file. When "AudioDeviceSamplesPerSec" is set on config file, the audio device is opened
for the specified sampling rate rather than the clip's sampling rate.
Where does the audio session check against the audio device properties
(channels, sample rate) ?
(Is there some validation done for mono, stereo property of the audio device
and appropriate conversion ?)
You pretty much have it. The media engine will always try to open the audio
device with the native properties of the clip being played. We never want to
resample unless we have to. This is done, as you found out, by building a table
of samplerate, channels, samplewidths combinations from the most desirable to
the least. After that we simply loop through this table and call _CheckFormat()
on each one. The first one that the audio code (audio/device/hxaudev.cpp)
returns
TRUE on we use. The media engine will then, if needed, resample everything to
that frequency. If there are certain frequencies you don't want to use you can
just check for them in hxuadev.cpp and return FALSE. We do this on some embedded
platforms, for example, that only support a certain set of samplerates or
channels.
--greg
Thanks,
Rajesh.
_______________________________________________
Audio-dev mailing list
Audio-dev@helixcommunity.org
http://lists.helixcommunity.org/mailman/listinfo/audio-dev