Pages: 1 ... 12 13 [14]   Go Down
Author Topic: New library for PWM playback from SD cards: SimpleSDAudio  (Read 42440 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

how to build class
play next, previous file
Please help smiley

THX
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hmm
#include <SimpleSDAudio.h>
not working with
#include <SD.h>
 smiley-sad
Logged

Offline Offline
Jr. Member
**
Karma: 6
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hm, *looking into crystal ball*, try starting with the examples provided by the library. Use Arduino IDE V1.0.x instead of beta versions in case of build trouble.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great project!!! i will try it!

i am just looking not very much for quality but if possible gapless play of parts of the file or between files... don't know if possible. Want to use atmega328 or 2560

thanks!!
Logged

Offline Offline
Jr. Member
**
Karma: 6
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Gap-less playback from SD is always a challenge. Even the .play() function might be fast enough, at least the .setFile() function will always do a lot of searching through the FAT filesystem. First try to play the same file again and again using a loop like:

Code:
while(1) {
   if(SdPlay.isStopped()) SdPlay.play();
}

If this works ok for you, you might youself patch the library in a way that the information that is retrieved by setFile is stored somewhere in RAM and used for quicker change of the file to playback. But this might be not the right starting-project for beginners...
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Gap-less playback from SD is always a challenge. Even the .play() function might be fast enough, at least the .setFile() function will always do a lot of searching through the FAT filesystem. First try to play the same file again and again using a loop like:

Code:
while(1) {
   if(SdPlay.isStopped()) SdPlay.play();
}

If this works ok for you, you might youself patch the library in a way that the information that is retrieved by setFile is stored somewhere in RAM and used for quicker change of the file to playback. But this might be not the right starting-project for beginners...

Thank you SO MUCH for the quick answer and the tip too! ... I'll check it and come back with results..
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 6
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi again.. used the code below

Code:
while (S < 1000) {
    S=(pulseIn(13,HIGH,20000);
    if (millis()-t > 999){p=1;t=millis();
    if (p == 1) {
      SdPlay.setFile("START.AFM");
      SdPlay.play();p=0;t=millis();}
and my loop played perfect!!.. BUT now i noticed another problem with pulseIn as i am reading a PWM input to change sounds...

any tips if i can do that? is this an interrupt problem or because changes of the timers? is there anyway to measure PWM while playing sound?
« Last Edit: February 16, 2014, 03:49:33 am by skoubri » Logged

Stendal, D
Offline Offline
Newbie
*
Karma: 4
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there a way to adjust the volume?
I have a home automation including a clock with my arduino mega, and  would decrease the sound (westminster gong) in the night and set it to normal (it's loud enough) at the day.
Currently i must disable the sound in the night smiley-sad
thanks
Logged

Offline Offline
Jr. Member
**
Karma: 6
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
actually there is no such a feature. But usually SD cards have plenty of space - so just prepare one set of files with a lower volume (using a wav editor like Audacity) and switch between them.
Logged

Stendal, D
Offline Offline
Newbie
*
Karma: 4
Posts: 12
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
actually there is no such a feature. But usually SD cards have plenty of space - so just prepare one set of files with a lower volume (using a wav editor like Audacity) and switch between them.


Good idea. Done. Works.
Thanks...
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

its possible make this with this library? http://onixarts.pl/blog/2014/01/arduino-soundcard
Logged

Pages: 1 ... 12 13 [14]   Go Up
Jump to: