Sonny05
Posts: 22
Joined: Wed Jun 24, 2015 4:53 pm

PWM sound

Thu Dec 17, 2015 4:09 pm

Hi,

I'm doing on the demo that will play sound. I have three audio files.

1, sampleRate=44100 BitsPerSample=8bit MONO
2, sampleRate=44100 BitsPerSample=16bit MONO
3, sampleRate=44100 BitsPerSample=32bit MONO

The first two files go to play, but the third file I can only hear the buzz (noise).

Someone advise me what am I doing wrong?

Thanks

User avatar
RST8
Posts: 64
Joined: Tue Nov 25, 2014 1:57 pm

Re: PWM sound

Thu Dec 17, 2015 4:49 pm

Sonny05 wrote:Hi,

I'm doing on the demo that will play sound. I have three audio files.

1, sampleRate=44100 BitsPerSample=8bit MONO
2, sampleRate=44100 BitsPerSample=16bit MONO
3, sampleRate=44100 BitsPerSample=32bit MONO

The first two files go to play, but the third file I can only hear the buzz (noise).

Someone advise me what am I doing wrong?

Thanks
If the file really is a 32 bits per sample, then it's simply the audio software not handling such a format, which is not surprising as even the "pro audio" 24 bit has a theoretical range of 144dB, which considering a jet take off is 140dB, is way more than most playback systems could ever manage. A 32 bit file would have a theoretical range of 192dB, louder than standing next to a Saturn rocket take off.
Bear in mind also that using the 3.5mm jack on the Pi means an effective resolution of ~12bits, so unless you're using an external DAC, the quality of the 16bit file is going to be compromised.

What are you trying to demo with the different resolutions (Apart from consuming more disk space) ?

Joe

Sonny05
Posts: 22
Joined: Wed Jun 24, 2015 4:53 pm

Re: PWM sound

Thu Dec 17, 2015 5:41 pm

I am trying to provide user a different quality files for playback.
I am aware that the more are files "quality" that take up more space.

I know the quality of the 16bit file is going to be compromised and it is best to use 12-bit.
My goal is to playback the file even if the quality is not the same as the original file.

Return to “Bare metal, Assembly language”