Change Speed of MP3 file

Writing software that inputs and/or outputs audio and performs DSP algorithms such as filters, new codecs or audio effects.
jtlechem
User
Posts: 16
Joined: Tue 2022-05-10 23:54

Re: Change Speed of MP3 file

Post by jtlechem »

Thank you very much for the guidance here, I feel like I understand much better now. And good point about how to utilize that volume control, I was still fixated on tempo control. So looks like there's a couple ways to achieve my task. Now just ("just") to mess with the hardware and figure out how to code it.
Thanks!
manu_espagne
User
Posts: 3
Joined: Thu 2023-03-09 18:13

Re: Change Speed of MP3 file

Post by manu_espagne »

Hello ,

I'm Emmanuel, an electronic from FRANCE. I want to simulate the sound of a steam locomotive which speed varies. I have a mp3 file for one speed and i need to downsample it from 44100 hz to 10000 Hz with 10 steps. I've tried to modify SCI_CLOCKF but i've difficulties with the datasheet of the VS1053B
Can you explain or give me the 10 values of the SCI_CLOCKF register that i use to put into my microcontroller?
Can i change continuosly the sample rate during the reading of the mp3 file wih SCI_CLOCKF or is there another solution with the VS1053B?
Can you be the more precise possible, and send me files example for microcontroller for similar applications
I use a mikromedia for pic 18 FJ board manufactured by Mikroelektronika

Thanks a lot,

Best regards

Emmanuel from FRANCE
User avatar
pasi
VLSI Staff
Posts: 2123
Joined: Thu 2010-07-15 16:04

Re: Change Speed of MP3 file

Post by pasi »

manu_espagne wrote: Thu 2023-03-09 18:28I have a mp3 file for one speed and i need to downsample it from 44100 hz to 10000 Hz with 10 steps. I've tried to modify SCI_CLOCKF
I don't think the CLOCKF adjustment method is suitable for this, it is better for very fine-tuned adjustment.

You can probably just write the samplerate you want to SCI_AUDATA whenever you need to. If you keep sending the same mp3 over and over in a loop without resetting the decoder in-between, the mp3 decoder never exits and also never updates the samplerate. (The mp3 decoder has its internal copy of the rate it is currently playing at, and if it doesn't see any change in the samplerate of the mp3 stream, it doesn't tell the audio output to change its rate. Thus your write to SCI_AUDATA won't get overwritten.)
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
manu_espagne
User
Posts: 3
Joined: Thu 2023-03-09 18:13

Re: Change Speed of MP3 file

Post by manu_espagne »

Hello pasy,

It's Emmanuel from FRANCE again. Thanks a lot for you quickly answer.If i understand well, i need to modify the SCI_audata register, i will try that. i must send the mp3 file continuously, and send sometimes sending some octet to modify the SCI_AUDATA register, but when?
It will be good, that you send me a file in C language for Arduino or Pic that do that, because you're much much experimented than me with the VS1053B!!!
i'm waiting for your file

Thanks a lot
Have a good week,

Emmanuel
User avatar
pasi
VLSI Staff
Posts: 2123
Joined: Thu 2010-07-15 16:04

Re: Change Speed of MP3 file

Post by pasi »

You write SCI_AUDATA to change the samplerate when your locomotive speed changes.

If you send the mp3 data in 32-byte blocks, you can check for this change after each block. You would then deassert xDCS and perform the SCI write operation.

There are microcontroller examples in other threads, I don't have code specifically for Pic.
Visit https://www.facebook.com/VLSISolution VLSI Solution on Facebook
manu_espagne
User
Posts: 3
Joined: Thu 2023-03-09 18:13

Re: Change Speed of MP3 file

Post by manu_espagne »

Hello Pasi,

It's Emmanuel from FRANCE again. I've made some trying with my mikromedia board from mikroelektronika but no results the sample frequency is always the same!!!. So i join to you my code in mikroc, and i hope you would correct it. I'm not pressed take your time!!!

Anyher question: What state or town of the USA are you from? Is there many trains, a railway station?

Thanks a lot for your corrected soft

Emmanuel,
MP3_echantillonnage.c
(7.4 KiB) Downloaded 91 times
]
Post Reply