AudioPlayer and differents WAV playing #2014
-
Hello @pschatzmann, I'm trying to play several WAV with differentes bits per samples, sampling rate, etc, but only 16bits/22Khz play well the others else play wrongs. What I should be into account to play WAV correctly depending of the WAV file setting? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments 18 replies
-
I am not sure what you are doing wrong: but this should definitly work! |
Beta Was this translation helpful? Give feedback.
-
Hi @pschatzmann , The log says me following:
I have noticed that I2SCodecStream says me that not supports 8-bits. I don't understand. |
Beta Was this translation helpful? Give feedback.
-
Anyway I test with 16-bits mono WAV file at 22KHz and the output is not adapted to 22KHz for sampling rate, the output is always in 44.1KHz. Else I used addNotifyAudioChange(kitStream); where kitStream is AudioBoardStream kitStream(powadcr_board); |
Beta Was this translation helpful? Give feedback.
-
Hi @pschatzmann, I don't know from where the problem comes. This below is my media player. With MP3 appears works fine but not with WAV. If some WAV of the directory is at 22.1KHz the output is not adapted to this sampling rate, and plays slowed down. have a look. To test it you only need a kitStream object as AudioBoardStream, all rest of mediaplayer is content in this following method. Put ACTIVE_AMP as false If you want you can used my code (optimized by you or not) for complete PLAYER example.
|
Beta Was this translation helpful? Give feedback.
-
@pschatzmann Where Can I found examples with AudioInfoSupport? |
Beta Was this translation helpful? Give feedback.
-
In the class documentation |
Beta Was this translation helpful? Give feedback.
-
Why this below doesn't work with WAV? I'm monitoring that AudioKitStream is set to 22KHz and decoder at 44.1KHz, with MP3 all is OK and after these lines below, AudioKitStream put output at 44.1KHz, why with WAV not? decoder is a MultiDecoder.
|
Beta Was this translation helpful? Give feedback.
-
Ok. I already know the problem. Is not the sampling rate is the bits per sample. How I do to plays correctly with AudioPlayer a 8-bit WAV? |
Beta Was this translation helpful? Give feedback.
-
Ok, I understand but. How Can I convert conditionated to the bit_per_sample of the file to be played? |
Beta Was this translation helpful? Give feedback.
-
One doubt. Who has the information of sampling rate of the source file (wav, mp3, etc) decoder? player? I've saw that a 8-bit and 22KHz wav sample if I get sampling rate info from decoder is not correct. |
Beta Was this translation helpful? Give feedback.
-
Ok. I see that in the wav file header that I'm using for testing If you observe, the native sampling rate is 22KHz. Well, when I ask to decoder and player, both say me that file is at 44.1KHz. Why?
|
Beta Was this translation helpful? Give feedback.
-
Ok. sampling rate issue solved. But I don't achieve to solve the transformation to different bits_per_sample. The player freezes when I try to convert. Then the chain is that below. source -> decoder -> player -> eq -> EncodedAudioStream -> Transformation -> AudioBoardStrem out. |
Beta Was this translation helpful? Give feedback.
I am not sure what you are doing wrong: but this should definitly work!