Arduino Forum

Using Arduino => Audio => Topic started by: 2C3D on May 16, 2019, 06:07 pm

Title: TMRpcm, when told to play from a working, readable SD card, doesn't play.
Post by: 2C3D on May 16, 2019, 06:07 pm
I have tested the speaker using another program on the same pin. It works.

I have tested the SD card using the cardinfo sketch. It works.

Running SD.begin() works.

Note: I've named my TMRpcm object player

player.play("song.wav"); and player.play("SONG.WAV"); have been tested. Filename on card is song.wav, but the cardinfo sketch calls it SONG.WAV, so I tested both versions.

player.isPlaying() returns false, so it knows it isn't playing.

running player.pause(); doesn't turn it on.

I have confirmed that the program runs with 701 somethings of memory to spare.

Have also tried:
player.volume(1);
player.setVolume(7);
player.loop(1);

Edit: I'm using an arduino uno, my speaker is on pin 9 and and the SD is on the adafruit 254.
Title: Re: TMRpcm, when told to play from a working, readable SD card, doesn't play.
Post by: SchnoppDog on May 21, 2019, 11:12 am
First it would be nice if you paste your code in this forum (Don't forget the code tags!). If you only tell us what doesn't work and what you've tried but don't provide any code we can't understand what you did exactly.
Second: Which Hardware are you using and how did you connect them to eachother? Maybe you've set  it up in a wrong way.

Using "player.pause()" can't "play" music-files. It only pauses music and re-plays it at the paused timestamp.

"player.volume", "player.setVolume" and "player.loop" don't have anything to do with playing files exactly. For playing files you only use "player.play("song_name.wav").

Also remind that your wav-file has to be unsigned 8bit mono between 8 and 16khz.