Unable to play high resolution of spresense with arduino player_objif sketch

Asked 1 years ago, Updated 1 years ago, 241 views

I tried to play 96 kHz sampling rate sound source in arduino sketch player_objif, but I couldn't.
For playback, the following description has been changed to ↓.
The sound source played an upchirp signal that transitions from 0k to 48k in 5 seconds, but it takes about 10 seconds to transition from 0k to 12k (called Main player File End!).
I was able to play it with player_hires, but does it not work with programs with object interface layers used in player_objif?
Thank you for your cooperation.

theMixer->setRenderingClkMode(OUTPUTMIXER_RNDCLK_NORMAL);
↓
theMixer->setRenderingClkMode(OUTPUTMIXER_RNDCLK_HIRESO);

the Player->init(MediaPlayer:: Player0, AS_CODECTYPE_MP3, "/mnt/sd0/BIN", AS_SAMPLINGRATE_48000, AS_CHANNEL_STEREO);
↓
the Player->init(MediaPlayer:: Player0, AS_CODECTYPE_WAV, "/mnt/sd0/BIN", AS_SAMPLINGRATE_192000, AS_CHANNEL_MONO);

myFile=theSD.open("Sound.mp3");
↓
myFile=theSD.open("Sound.wav");

spresense

2022-09-30 21:56

2 Answers

This is a comment from the point of view of the question.
"Replay the 96 kHz sampling rate sound source", so please send the 96 kHz sampling WAV file

the Player->init (MediaPlayer:: Player0, AS_CODECTYPE_WAV, "/mnt/sd0/BIN", AS_SAMPLINGRATE_192000, AS_CHANNEL_MONO);

If you play it with 192 kHz sampling, it will double the speed.
5 seconds is 2.5 seconds and the frequency goes up, but the actual behavior is the opposite, so
The playback seems to be 48 kHz.

Also, if the channels were different (such as playing Stereo with mono), the LR alignment would be played on the same channel, so the audio would sometimes double.


2022-09-30 21:56

I understood after trying various things.
As you said, it seems that the above code will eventually produce 48 kHz output and cannot produce high resolution output.

So I noticed it when I looked at the SDK code.
Probably
theMixer->setRenderingClkMode(OUTPUTMIXER_RNDCLK_HIRESO);
It would be good to change the timing of calling .

If you call here before begin as shown below,

theMixer->setRenderingClkMode(OUTPUTMIXER_RNDCLK_HIRESO);

the Player ->begin();
theMixer->begin();

This code has been able to play high resolution.


2022-09-30 21:56

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.