Author Topic: Dedicated MP3 player  (Read 2211 times)

0 Members and 1 Guest are viewing this topic.

Offline RadioNerd

  • Contributor
  • Posts: 38
  • Country: ch
Re: Dedicated MP3 player
« Reply #25 on: July 17, 2019, 05:35:49 am »
Just as a side note: Ocean wave sound is actually much closer to 1/f noise rather than white noise.
pure white noise is not very relaxing in my opinion
 

Offline Canis Dirus Leidy

  • Regular Contributor
  • *
  • Posts: 152
  • Country: ru
Re: Dedicated MP3 player
« Reply #26 on: July 17, 2019, 08:32:17 pm »
 

Offline PerranOak

  • Frequent Contributor
  • **
  • Posts: 313
  • Country: gb
Re: Dedicated MP3 player
« Reply #27 on: July 18, 2019, 04:00:00 pm »
Thanks guys but I really have to use the WAV file supplied by SWMBO.

SiliconWizard thank you for searching that out - you are spot-on about the BGAs! I've been using a lowercase "b" for years  :palm:

So, flash memory is ideal for this then? I really want to do it with memory rather than SD or anything like that.
I guess then that WAV files have 8 bits to the byte?
What I'd really like to do is to write all the code from scratch, if this is achievable, but I don't even know how to "inspect"/"edit" a WAV file so that I could copy the data!
Some light can never be seen!
RJD
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 5338
  • Country: fr
Re: Dedicated MP3 player
« Reply #28 on: July 18, 2019, 04:33:51 pm »
I guess then that WAV files have 8 bits to the byte?

Well, yes!

A WAV file has a RIFF structure. If you don't want to write a WAV file parser, which is not that difficult (but still, if you really want to write a DECENT one, just skipping a supposed fixed header is NOT the way to go IMO, so I wouldn't personally do that AND thus I will warn you that writing a correct parser is not completely trivial. A WAV file can contain many additional chunks than just a header and the audio samples), I would suggest you choose a fixed sample rate, and write the audio data as raw samples in the memory chip, along with just the number of samples. Many audio editors can save a WAV file as RAW data. I think that would be the easiest path for you. Audacity can export audio as a RAW file with various sample encoding options, such as 16-bit signed or 24-bit signed integers.


 

Online NiHaoMike

  • Super Contributor
  • ***
  • Posts: 6250
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Dedicated MP3 player
« Reply #29 on: July 19, 2019, 05:00:18 am »
Perform a spectral analysis on the file and then make a noise generator with very similar spectral characteristics.
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline PerranOak

  • Frequent Contributor
  • **
  • Posts: 313
  • Country: gb
Re: Dedicated MP3 player
« Reply #30 on: July 19, 2019, 12:47:51 pm »
As I need to use the file as given (thanks anyway NiHaoMike) I'll try-out the RAW option; I already have Audacity. Cheers.
Some light can never be seen!
RJD
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 5338
  • Country: fr
Re: Dedicated MP3 player
« Reply #31 on: July 19, 2019, 12:58:10 pm »
I think that will be the simpler option really if you don't want to have to deal with file formats, SD cards and filesystems, and using a flash chip this way will be much easier to understand and easier to get something working in real-time. And if your intent is not to develop a full-blown audio player, but a dedicated one as I understood it, that's perfectly fine. Of course just keep in mind that changing the audio content will require a "maintenance" and the user won't be able to do it themselves, which is not necessarily a problem here. (Note that it could still be implemented later on if you're using an MCU that supports USB, but that would obviously require more work...)

In Audacity just use Export / Export Audio, select "other formats", then "RAW (headerless)" for the header, and then the encoding you want for the samples (ideally the same format as what you'll directly send to the DAC).
 

Online NiHaoMike

  • Super Contributor
  • ***
  • Posts: 6250
  • Country: us
  • "Don't turn it on - Take it apart!"
    • Facebook Page
Re: Dedicated MP3 player
« Reply #32 on: July 19, 2019, 01:25:10 pm »
As I need to use the file as given (thanks anyway NiHaoMike) I'll try-out the RAW option; I already have Audacity. Cheers.
Except you are still using the file - you're using it as a reference for what the output should be like. Would it be OK to post at least a short clip of the file? That should give us ideas on how to generate the output or downsample it to reduce storage requirements. (E.g. can it be truncated to 8 bit 22kHz without too much quality loss? Can a short piece of it be looped without introducing a noticeable discontinuity where it restarts?)
Cryptocurrency has taught me to love math and at the same time be baffled by it.

Cryptocurrency lesson 0: Altcoins and Bitcoin are not the same thing.
 

Offline MT

  • Super Contributor
  • ***
  • Posts: 1290
  • Country: cn
Re: Dedicated MP3 player
« Reply #33 on: July 19, 2019, 08:49:11 pm »
Quote from: Mr. Scram
Some loathe ASMR with enthusiasm.

Some enjoy ASMR, some enjoy the silence, some both. Milage varies! :-//
 

Offline Old Printer

  • Frequent Contributor
  • **
  • Posts: 574
  • Country: us
Re: Dedicated MP3 player
« Reply #34 on: July 21, 2019, 06:42:33 pm »
I know this does not address the OP's dilemma, or the spirit of the project, but as someone who really needs a constant background noise to sleep I will offer this. There is an app for that, of course. It's called Rain Rain, and I have it on all of my Ios devices. I travel a bit, and after getting searched at TSA too many times for an odd looking electronic device in my carry-on, I tried it. Many sounds to choose from and a low drain overnight on the battery if you are not on a charger.
 

Offline @rt

  • Frequent Contributor
  • **
  • Posts: 988
Re: Dedicated MP3 player
« Reply #35 on: July 22, 2019, 03:15:16 am »
The MP3 player chips from VLSI Solutions (ie. VS1003B) are designed to be used with microcontrollers that provide GUI, and move data from SD card to the chip, etc.
but they also have a minimal mode set by holding a pin in a particular state so that a simple MP3 player can be constructed with no programming.
That requires the chip (or module/shield), SD card, and crystal. The resulting player will just go play whatever MP3 files are at the root of the card.

But yeah, given that you can get an eBay USB MP3 player under $10AU, I’d not bother for the problem as I understand it.
 

Offline luiHS

  • Frequent Contributor
  • **
  • Posts: 366
  • Country: es
    • Pinballsp
Re: Dedicated MP3 player
« Reply #36 on: August 05, 2019, 07:18:45 pm »


Teensy Audio Library, and a Kinetis microcontroller, is all you need to make your own audio player. I have built some Kinetis-based sound players for machines that needed custom sounds, activated from a main processor, connected by serial port, and they worked very well.

It is a cheap solution, and you have total control, you can modify the software to work as you want, without dependencies of proprietary chips like those of VLSI, and others of the Chinese.

https://www.pjrc.com/teensy/td_libs_Audio.html


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf