SFEMP3Shield  1.02.14
Arduino Library for VS10xx shield
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
FilePlayer.ino
Go to the documentation of this file.
1 
26 #include <SPI.h>
27 
28 //Add the SdFat Libraries
29 #include <SdFat.h>
30 #include <SdFatUtil.h>
31 
32 //and the MP3 Shield Library
33 #include <SFEMP3Shield.h>
34 
35 // Below is not needed if interrupt driven. Safe to remove if not using.
36 #if defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_Timer1
37  #include <TimerOne.h>
38 #elif defined(USE_MP3_REFILL_MEANS) && USE_MP3_REFILL_MEANS == USE_MP3_SimpleTimer
39  #include <SimpleTimer.h>
40 #endif
41 
47 SdFat sd;
48 
55 int16_t last_ms_char; // milliseconds of last recieved character from Serial port.
56 int8_t buffer_pos; // next position to recieve character from Serial port.
57 
58 //------------------------------------------------------------------------------
72  char buffer[6]; // 0-35K+null
73 
74 void setup() {
75 
76  uint8_t result; //result code from some function as to be tested at later time.
77 
78  Serial.begin(115200);
79 
80  Serial.print(F("F_CPU = "));
81  Serial.println(F_CPU);
82  Serial.print(F("Free RAM = ")); // available in Version 1.0 F() bases the string to into Flash, to use less SRAM.
83  Serial.print(FreeRam(), DEC); // FreeRam() is provided by SdFatUtil.h
84  Serial.println(F(" Should be a base line of 1017, on ATmega328 when using INTx"));
85 
86 
87  //Initialize the SdCard.
88  if(!sd.begin(SD_SEL, SPI_FULL_SPEED)) sd.initErrorHalt();
89  // depending upon your SdCard environment, SPI_HAVE_SPEED may work better.
90  if(!sd.chdir("/")) sd.errorHalt("sd.chdir");
91 
92  //Initialize the MP3 Player Shield
93  result = MP3player.begin();
94  //check result, see readme for error codes.
95  if(result != 0) {
96  Serial.print(F("Error code: "));
97  Serial.print(result);
98  Serial.println(F(" when trying to start MP3 player"));
99  if( result == 6 ) {
100  Serial.println(F("Warning: patch file not found, skipping.")); // can be removed for space, if needed.
101  Serial.println(F("Use the \"d\" command to verify SdCard can be read")); // can be removed for space, if needed.
102  }
103  }
104 
105 #if (0)
106  // Typically not used by most shields, hence commented out.
107  Serial.println(F("Applying ADMixer patch."));
108  if(MP3player.ADMixerLoad("admxster.053") == 0) {
109  Serial.println(F("Setting ADMixer Volume."));
110  MP3player.ADMixerVol(-3);
111  }
112 #endif
113 
114  help();
115  last_ms_char = millis(); // stroke the inter character timeout.
116  buffer_pos = 0; // start the command string at zero length.
117  parse_menu('l'); // display the list of files to play
118 
119 }
120 
121 //------------------------------------------------------------------------------
135 void loop() {
136 
137 // Below is only needed if not interrupt driven. Safe to remove if not using.
138 #if defined(USE_MP3_REFILL_MEANS) \
139  && ( (USE_MP3_REFILL_MEANS == USE_MP3_SimpleTimer) \
140  || (USE_MP3_REFILL_MEANS == USE_MP3_Polled) )
141 
142  MP3player.available();
143 #endif
144 
145  char inByte;
146  if (Serial.available() > 0) {
147  inByte = Serial.read();
148  if ((0x20 <= inByte) && (inByte <= 0x126)) { // strip off non-ASCII, such as CR or LF
149  if (isDigit(inByte)) { // macro for ((inByte >= '0') && (inByte <= '9'))
150  // else if it is a number, add it to the string
151  buffer[buffer_pos++] = inByte;
152  } else {
153  // input char is a letter command
154  buffer_pos = 0;
155  parse_menu(inByte);
156  }
157  buffer[buffer_pos] = 0; // update end of line
158  last_ms_char = millis(); // stroke the inter character timeout.
159  }
160  } else if ((millis() - last_ms_char) > 500 && ( buffer_pos > 0 )) {
161  // ICT expired and have something
162  if (buffer_pos == 1) {
163  // look for single byte (non-number) menu commands
165 
166  } else if (buffer_pos > 5) {
167  // dump if entered command is greater then uint16_t
168  Serial.println(F("Ignored, Number is Too Big!"));
169 
170  } else {
171  // otherwise its a number, scan through files looking for matching index.
172  int16_t fn_index = atoi(buffer);
173  SdFile file;
174  char filename[13];
175  sd.chdir("/",true);
176  uint16_t count = 1;
177  while (file.openNext(sd.vwd(),O_READ))
178  {
179  file.getFilename(filename);
180  if ( isFnMusic(filename) ) {
181 
182  if (count == fn_index) {
183  Serial.print(F("Index "));
184  SerialPrintPaddedNumber(count, 5 );
185  Serial.print(F(": "));
186  Serial.println(filename);
187  Serial.print(F("Playing filename: "));
188  Serial.println(filename);
189  int8_t result = MP3player.playMP3(filename);
190  //check result, see readme for error codes.
191  if(result != 0) {
192  Serial.print(F("Error code: "));
193  Serial.print(result);
194  Serial.println(F(" when trying to play track"));
195  }
196  char title[30]; // buffer to contain the extract the Title from the current filehandles
197  char artist[30]; // buffer to contain the extract the artist name from the current filehandles
198  char album[30]; // buffer to contain the extract the album name from the current filehandles
199  MP3player.trackTitle((char*)&title);
200  MP3player.trackArtist((char*)&artist);
201  MP3player.trackAlbum((char*)&album);
202 
203  //print out the arrays of track information
204  Serial.write((byte*)&title, 30);
205  Serial.println();
206  Serial.print(F("by: "));
207  Serial.write((byte*)&artist, 30);
208  Serial.println();
209  Serial.print(F("Album: "));
210  Serial.write((byte*)&album, 30);
211  Serial.println();
212  break;
213  }
214  count++;
215  }
216  file.close();
217  }
218 
219  }
220 
221  //reset buffer to start over
222  buffer_pos = 0;
223  buffer[buffer_pos] = 0; // delimit
224  }
225 
226  delay(100);
227 }
228 
229 uint32_t millis_prv;
230 
231 //------------------------------------------------------------------------------
239 void parse_menu(byte key_command) {
240 
241  uint8_t result; // result code from some function as to be tested at later time.
242 
243  // Note these buffer may be desired to exist globably.
244  // but do take much space if only needed temporarily, hence they are here.
245  char title[30]; // buffer to contain the extract the Title from the current filehandles
246  char artist[30]; // buffer to contain the extract the artist name from the current filehandles
247  char album[30]; // buffer to contain the extract the album name from the current filehandles
248 
249  Serial.print(F("Received command: "));
250  Serial.write(key_command);
251  Serial.println(F(" "));
252 
253  //if s, stop the current track
254  if(key_command == 's') {
255  Serial.println(F("Stopping"));
256  MP3player.stopTrack();
257 
258  //if 1-9, play corresponding track
259  } else if(key_command >= '1' && key_command <= '9') {
260  //convert ascii numbers to real numbers
261  key_command = key_command - 48;
262 
263 #if USE_MULTIPLE_CARDS
264  sd.chvol(); // assign desired sdcard's volume.
265 #endif
266  //tell the MP3 Shield to play a track
267  result = MP3player.playTrack(key_command);
268 
269  //check result, see readme for error codes.
270  if(result != 0) {
271  Serial.print(F("Error code: "));
272  Serial.print(result);
273  Serial.println(F(" when trying to play track"));
274  } else {
275 
276  Serial.println(F("Playing:"));
277 
278  //we can get track info by using the following functions and arguments
279  //the functions will extract the requested information, and put it in the array we pass in
280  MP3player.trackTitle((char*)&title);
281  MP3player.trackArtist((char*)&artist);
282  MP3player.trackAlbum((char*)&album);
283 
284  //print out the arrays of track information
285  Serial.write((byte*)&title, 30);
286  Serial.println();
287  Serial.print(F("by: "));
288  Serial.write((byte*)&artist, 30);
289  Serial.println();
290  Serial.print(F("Album: "));
291  Serial.write((byte*)&album, 30);
292  Serial.println();
293  }
294 
295  //if +/- to change volume
296  } else if((key_command == '-') || (key_command == '+')) {
297  union twobyte mp3_vol; // create key_command existing variable that can be both word and double byte of left and right.
298  mp3_vol.word = MP3player.getVolume(); // returns a double uint8_t of Left and Right packed into int16_t
299 
300  if(key_command == '-') { // note dB is negative
301  // assume equal balance and use byte[1] for math
302  if(mp3_vol.byte[1] >= 254) { // range check
303  mp3_vol.byte[1] = 254;
304  } else {
305  mp3_vol.byte[1] += 2; // keep it simpler with whole dB's
306  }
307  } else {
308  if(mp3_vol.byte[1] <= 2) { // range check
309  mp3_vol.byte[1] = 2;
310  } else {
311  mp3_vol.byte[1] -= 2;
312  }
313  }
314  // push byte[1] into both left and right assuming equal balance.
315  MP3player.setVolume(mp3_vol.byte[1], mp3_vol.byte[1]); // commit new volume
316  Serial.print(F("Volume changed to -"));
317  Serial.print(mp3_vol.byte[1]>>1, 1);
318  Serial.println(F("[dB]"));
319 
320  //if < or > to change Play Speed
321  } else if((key_command == '>') || (key_command == '<')) {
322  uint16_t playspeed = MP3player.getPlaySpeed(); // create key_command existing variable
323  // note playspeed of Zero is equal to ONE, normal speed.
324  if(key_command == '>') { // note dB is negative
325  // assume equal balance and use byte[1] for math
326  if(playspeed >= 254) { // range check
327  playspeed = 5;
328  } else {
329  playspeed += 1; // keep it simpler with whole dB's
330  }
331  } else {
332  if(playspeed == 0) { // range check
333  playspeed = 0;
334  } else {
335  playspeed -= 1;
336  }
337  }
338  MP3player.setPlaySpeed(playspeed); // commit new playspeed
339  Serial.print(F("playspeed to "));
340  Serial.println(playspeed, DEC);
341 
342  /* Alterativly, you could call a track by it's file name by using playMP3(filename);
343  But you must stick to 8.1 filenames, only 8 characters long, and 3 for the extension */
344  } else if(key_command == 'f' || key_command == 'F') {
345  uint32_t offset = 0;
346  if (key_command == 'F') {
347  offset = 2000;
348  }
349 
350  //create a string with the filename
351  char trackName[] = "track001.mp3";
352 
353 #if USE_MULTIPLE_CARDS
354  sd.chvol(); // assign desired sdcard's volume.
355 #endif
356  //tell the MP3 Shield to play that file
357  result = MP3player.playMP3(trackName, offset);
358  //check result, see readme for error codes.
359  if(result != 0) {
360  Serial.print(F("Error code: "));
361  Serial.print(result);
362  Serial.println(F(" when trying to play track"));
363  }
364 
365  /* Display the file on the SdCard */
366  } else if(key_command == 'd') {
367  if(!MP3player.isPlaying()) {
368  // prevent root.ls when playing, something locks the dump. but keeps playing.
369  // yes, I have tried another unique instance with same results.
370  // something about SdFat and its 500byte cache.
371  Serial.println(F("Files found (name date time size):"));
372  sd.ls(LS_R | LS_DATE | LS_SIZE);
373  } else {
374  Serial.println(F("Busy Playing Files, try again later."));
375  }
376 
377  /* Get and Display the Audio Information */
378  } else if(key_command == 'i') {
379  MP3player.getAudioInfo();
380 
381  } else if(key_command == 'p') {
382  if( MP3player.getState() == playback) {
383  MP3player.pauseMusic();
384  Serial.println(F("Pausing"));
385  } else if( MP3player.getState() == paused_playback) {
386  MP3player.resumeMusic();
387  Serial.println(F("Resuming"));
388  } else {
389  Serial.println(F("Not Playing!"));
390  }
391 
392  } else if(key_command == 't') {
393  int8_t teststate = MP3player.enableTestSineWave(126);
394  if(teststate == -1) {
395  Serial.println(F("Un-Available while playing music or chip in reset."));
396  } else if(teststate == 1) {
397  Serial.println(F("Enabling Test Sine Wave"));
398  } else if(teststate == 2) {
399  MP3player.disableTestSineWave();
400  Serial.println(F("Disabling Test Sine Wave"));
401  }
402 
403  } else if(key_command == 'S') {
404  Serial.println(F("Current State of VS10xx is."));
405  Serial.print(F("isPlaying() = "));
406  Serial.println(MP3player.isPlaying());
407 
408  Serial.print(F("getState() = "));
409  switch (MP3player.getState()) {
410  case uninitialized:
411  Serial.print(F("uninitialized"));
412  break;
413  case initialized:
414  Serial.print(F("initialized"));
415  break;
416  case deactivated:
417  Serial.print(F("deactivated"));
418  break;
419  case loading:
420  Serial.print(F("loading"));
421  break;
422  case ready:
423  Serial.print(F("ready"));
424  break;
425  case playback:
426  Serial.print(F("playback"));
427  break;
428  case paused_playback:
429  Serial.print(F("paused_playback"));
430  break;
431  case testing_memory:
432  Serial.print(F("testing_memory"));
433  break;
434  case testing_sinewave:
435  Serial.print(F("testing_sinewave"));
436  break;
437  }
438  Serial.println();
439 
440  } else if(key_command == 'b') {
441  Serial.println(F("Playing Static MIDI file."));
442  MP3player.SendSingleMIDInote();
443  Serial.println(F("Ended Static MIDI file."));
444 
445 #if !defined(__AVR_ATmega32U4__)
446  } else if(key_command == 'm') {
447  uint16_t teststate = MP3player.memoryTest();
448  if(teststate == -1) {
449  Serial.println(F("Un-Available while playing music or chip in reset."));
450  } else if(teststate == 2) {
451  teststate = MP3player.disableTestSineWave();
452  Serial.println(F("Un-Available while Sine Wave Test"));
453  } else {
454  Serial.print(F("Memory Test Results = "));
455  Serial.println(teststate, HEX);
456  Serial.println(F("Result should be 0x83FF."));
457  Serial.println(F("Reset is needed to recover to normal operation"));
458  }
459 
460  } else if(key_command == 'e') {
461  uint8_t earspeaker = MP3player.getEarSpeaker();
462  if(earspeaker >= 3){
463  earspeaker = 0;
464  } else {
465  earspeaker++;
466  }
467  MP3player.setEarSpeaker(earspeaker); // commit new earspeaker
468  Serial.print(F("earspeaker to "));
469  Serial.println(earspeaker, DEC);
470 
471  } else if(key_command == 'r') {
472  MP3player.resumeMusic(2000);
473 
474  } else if(key_command == 'R') {
475  MP3player.stopTrack();
476  MP3player.vs_init();
477  Serial.println(F("Reseting VS10xx chip"));
478 
479  } else if(key_command == 'g') {
480  int32_t offset_ms = 20000; // Note this is just an example, try your own number.
481  Serial.print(F("jumping to "));
482  Serial.print(offset_ms, DEC);
483  Serial.println(F("[milliseconds]"));
484  result = MP3player.skipTo(offset_ms);
485  if(result != 0) {
486  Serial.print(F("Error code: "));
487  Serial.print(result);
488  Serial.println(F(" when trying to skip track"));
489  }
490 
491  } else if(key_command == 'k') {
492  int32_t offset_ms = -1000; // Note this is just an example, try your own number.
493  Serial.print(F("moving = "));
494  Serial.print(offset_ms, DEC);
495  Serial.println(F("[milliseconds]"));
496  result = MP3player.skip(offset_ms);
497  if(result != 0) {
498  Serial.print(F("Error code: "));
499  Serial.print(result);
500  Serial.println(F(" when trying to skip track"));
501  }
502 
503  } else if(key_command == 'O') {
504  MP3player.end();
505  Serial.println(F("VS10xx placed into low power reset mode."));
506 
507  } else if(key_command == 'o') {
508  MP3player.begin();
509  Serial.println(F("VS10xx restored from low power reset mode."));
510 
511  } else if(key_command == 'D') {
512  uint16_t diff_state = MP3player.getDifferentialOutput();
513  Serial.print(F("Differential Mode "));
514  if(diff_state == 0) {
515  MP3player.setDifferentialOutput(1);
516  Serial.println(F("Enabled."));
517  } else {
518  MP3player.setDifferentialOutput(0);
519  Serial.println(F("Disabled."));
520  }
521 
522  } else if(key_command == 'V') {
523  MP3player.setVUmeter(1);
524  Serial.println(F("Use \"No line ending\""));
525  Serial.print(F("VU meter = "));
526  Serial.println(MP3player.getVUmeter());
527  Serial.println(F("Hit Any key to stop."));
528 
529  while(!Serial.available()) {
530  union twobyte vu;
531  vu.word = MP3player.getVUlevel();
532  Serial.print(F("VU: L = "));
533  Serial.print(vu.byte[1]);
534  Serial.print(F(" / R = "));
535  Serial.print(vu.byte[0]);
536  Serial.println(" dB");
537  delay(1000);
538  }
539  Serial.read();
540 
541  MP3player.setVUmeter(0);
542  Serial.print(F("VU meter = "));
543  Serial.println(MP3player.getVUmeter());
544 
545  } else if(key_command == 'T') {
546  uint16_t TrebleFrequency = MP3player.getTrebleFrequency();
547  Serial.print(F("Former TrebleFrequency = "));
548  Serial.println(TrebleFrequency, DEC);
549  if (TrebleFrequency >= 15000) { // Range is from 0 - 1500Hz
550  TrebleFrequency = 0;
551  } else {
552  TrebleFrequency += 1000;
553  }
554  MP3player.setTrebleFrequency(TrebleFrequency);
555  Serial.print(F("New TrebleFrequency = "));
556  Serial.println(MP3player.getTrebleFrequency(), DEC);
557 
558  } else if(key_command == 'E') {
559  int8_t TrebleAmplitude = MP3player.getTrebleAmplitude();
560  Serial.print(F("Former TrebleAmplitude = "));
561  Serial.println(TrebleAmplitude, DEC);
562  if (TrebleAmplitude >= 7) { // Range is from -8 - 7dB
563  TrebleAmplitude = -8;
564  } else {
565  TrebleAmplitude++;
566  }
567  MP3player.setTrebleAmplitude(TrebleAmplitude);
568  Serial.print(F("New TrebleAmplitude = "));
569  Serial.println(MP3player.getTrebleAmplitude(), DEC);
570 
571  } else if(key_command == 'B') {
572  uint16_t BassFrequency = MP3player.getBassFrequency();
573  Serial.print(F("Former BassFrequency = "));
574  Serial.println(BassFrequency, DEC);
575  if (BassFrequency >= 150) { // Range is from 20hz - 150hz
576  BassFrequency = 0;
577  } else {
578  BassFrequency += 10;
579  }
580  MP3player.setBassFrequency(BassFrequency);
581  Serial.print(F("New BassFrequency = "));
582  Serial.println(MP3player.getBassFrequency(), DEC);
583 
584  } else if(key_command == 'C') {
585  uint16_t BassAmplitude = MP3player.getBassAmplitude();
586  Serial.print(F("Former BassAmplitude = "));
587  Serial.println(BassAmplitude, DEC);
588  if (BassAmplitude >= 15) { // Range is from 0 - 15dB
589  BassAmplitude = 0;
590  } else {
591  BassAmplitude++;
592  }
593  MP3player.setBassAmplitude(BassAmplitude);
594  Serial.print(F("New BassAmplitude = "));
595  Serial.println(MP3player.getBassAmplitude(), DEC);
596 
597  } else if(key_command == 'M') {
598  uint16_t monostate = MP3player.getMonoMode();
599  Serial.print(F("Mono Mode "));
600  if(monostate == 0) {
601  MP3player.setMonoMode(1);
602  Serial.println(F("Enabled."));
603  } else {
604  MP3player.setMonoMode(0);
605  Serial.println(F("Disabled."));
606  }
607 #endif
608 
609  /* List out music files on the SdCard */
610  } else if(key_command == 'l') {
611  if(!MP3player.isPlaying()) {
612  Serial.println(F("Music Files found :"));
613  SdFile file;
614  char filename[13];
615  sd.chdir("/",true);
616  uint16_t count = 1;
617  while (file.openNext(sd.vwd(),O_READ))
618  {
619  file.getFilename(filename);
620  if ( isFnMusic(filename) ) {
621  SerialPrintPaddedNumber(count, 5 );
622  Serial.print(F(": "));
623  Serial.println(filename);
624  count++;
625  }
626  file.close();
627  }
628  Serial.println(F("Enter Index of File to play"));
629 
630  } else {
631  Serial.println(F("Busy Playing Files, try again later."));
632  }
633 
634  } else if(key_command == 'h') {
635  help();
636  }
637 
638  // print prompt after key stroke has been processed.
639  Serial.print(F("Time since last command: "));
640  Serial.println((float) (millis() - millis_prv)/1000, 2);
641  millis_prv = millis();
642  Serial.print(F("Enter s,1-9,+,-,>,<,f,F,d,i,p,t,S,b"));
643 #if !defined(__AVR_ATmega32U4__)
644  Serial.print(F(",m,e,r,R,g,k,O,o,D,V,B,C,T,E,M:"));
645 #endif
646  Serial.println(F(",l,h :"));
647 }
648 
649 //------------------------------------------------------------------------------
655 void help() {
656  Serial.println(F("Arduino SFEMP3Shield Library Example:"));
657  Serial.println(F(" courtesy of Bill Porter & Michael P. Flaga"));
658  Serial.println(F("COMMANDS:"));
659  Serial.println(F(" [1-9] to play a track"));
660  Serial.println(F(" [f] play track001.mp3 by filename example"));
661  Serial.println(F(" [F] same as [f] but with initial skip of 2 second"));
662  Serial.println(F(" [s] to stop playing"));
663  Serial.println(F(" [d] display directory of SdCard"));
664  Serial.println(F(" [+ or -] to change volume"));
665  Serial.println(F(" [> or <] to increment or decrement play speed by 1 factor"));
666  Serial.println(F(" [i] retrieve current audio information (partial list)"));
667  Serial.println(F(" [p] to pause."));
668  Serial.println(F(" [t] to toggle sine wave test"));
669  Serial.println(F(" [S] Show State of Device."));
670  Serial.println(F(" [b] Play a MIDI File Beep"));
671 #if !defined(__AVR_ATmega32U4__)
672  Serial.println(F(" [e] increment Spatial EarSpeaker, default is 0, wraps after 4"));
673  Serial.println(F(" [m] perform memory test. reset is needed after to recover."));
674  Serial.println(F(" [M] Toggle between Mono and Stereo Output."));
675  Serial.println(F(" [g] Skip to a predetermined offset of ms in current track."));
676  Serial.println(F(" [k] Skip a predetermined number of ms in current track."));
677  Serial.println(F(" [r] resumes play from 2s from begin of file"));
678  Serial.println(F(" [R] Resets and initializes VS10xx chip."));
679  Serial.println(F(" [O] turns OFF the VS10xx into low power reset."));
680  Serial.println(F(" [o] turns ON the VS10xx out of low power reset."));
681  Serial.println(F(" [D] to toggle SM_DIFF between inphase and differential output"));
682  Serial.println(F(" [V] Enable VU meter Test."));
683  Serial.println(F(" [B] Increament bass frequency by 10Hz"));
684  Serial.println(F(" [C] Increament bass amplitude by 1dB"));
685  Serial.println(F(" [T] Increament treble frequency by 1000Hz"));
686  Serial.println(F(" [E] Increament treble amplitude by 1dB"));
687 #endif
688  Serial.println(F(" [l] Display list of music files"));
689  Serial.println(F(" [0####] Enter index of file to play, zero pad! e.g. 01-65534"));
690  Serial.println(F(" [h] this help"));
691 }
692 
693 void SerialPrintPaddedNumber(int16_t value, int8_t digits ) {
694  int currentMax = 10;
695  for (byte i=1; i<digits; i++){
696  if (value < currentMax) {
697  Serial.print("0");
698  }
699  currentMax *= 10;
700  }
701  Serial.print(value);
702 }
state_m getState()
Get the current state of the device.
void trackAlbum(char *)
Get Track&#39;s Album.
uint16_t getBassFrequency()
Get the current Bass Frequency limit from the VS10xx chip.
uint8_t getEarSpeaker()
Get the current Spatial EarSpeaker setting from the VS10xx chip.
bool resumeMusic()
Resume music from where it was paused.
void SendSingleMIDInote()
Play hardcoded MIDI file.
static void available()
Public interface of refill.
uint16_t getMonoMode()
Get the current Stereo/Mono setting of the VS10xx output.
int16_t getVUlevel()
get current measured VU Meter
int8_t setVUmeter(int8_t)
enable VSdsp VU Meter
void setPlaySpeed(uint16_t)
Set the current playSpeed of the VS10xx chip.
void help()
Print Help Menu.
Definition: FilePlayer.ino:655
uint16_t memoryTest()
Perform Memory Test.
void setBassFrequency(uint16_t)
Set the current Bass Boost Frequency limit cutoff in VS10xx chip.
uint16_t word
whole word value
Definition: SFEMP3Shield.h:826
void pauseMusic()
Pause music.
bool isFnMusic(char *filename)
is the filename music
int8_t getVUmeter()
get the status of the VSdsp VU Meter
int8_t getBassAmplitude()
Get the current Bass boost amplitude from the VS10xx chip.
uint8_t getDifferentialOutput()
Get the current SM_DIFF setting from the VS10xx chip.
SFEMP3Shield MP3player
Object instancing the SFEMP3Shield library.
Definition: FilePlayer.ino:54
void trackTitle(char *)
Get Track&#39;s Title.
uint16_t getPlaySpeed()
Get the current playSpeed from the VS10xx chip.
void setVolume(uint8_t, uint8_t)
Store and Push member volume to VS10xx chip.
void setBassAmplitude(uint8_t)
Set the current Bass Boost amplitude in VS10xx chip.
byte result
Definition: WebPlayer.ino:36
uint8_t enableTestSineWave(uint8_t)
Generate Test Sine wave.
int8_t buffer_pos
Definition: FilePlayer.ino:56
void parse_menu(byte key_command)
Decode the Menu.
Definition: FilePlayer.ino:239
uint8_t playMP3(char *, uint32_t timecode=0)
Begin playing a mp3 file by its filename.
void end()
Disables the MP3 Player shield.
void setTrebleFrequency(uint16_t)
Set the current treble frequency limit in VS10xx chip.
uint8_t vs_init()
Initialize the VS10xx Audio Decoder Chip.
void setEarSpeaker(uint16_t)
Set the current Spatial EarSpeaker setting of the VS10xx chip.
void trackArtist(char *)
Get Track&#39;s Artist.
void ADMixerVol(int8_t)
Set ADMixer&#39;s attenuation of input to between -3 and -31 dB otherwise disable.
uint8_t isPlaying()
Inidicate if a song is playing?
SdFile file
Definition: WebPlayer.ino:46
uint8_t playTrack(uint8_t)
Begin playing a mp3 file, just with a number.
void setup()
Definition: FilePlayer.ino:74
Header file for the SFEMP3Shield library.
void SerialPrintPaddedNumber(int16_t value, int8_t digits)
Definition: FilePlayer.ino:693
void setDifferentialOutput(uint16_t)
Set the current SM_DIFF setting of the VS10xx chip.
uint16_t getTrebleFrequency()
Get the current Treble Frequency limit from the VS10xx chip.
int8_t getTrebleAmplitude()
Get the current Treble Amplitude from the VS10xx chip.
uint8_t ADMixerLoad(char *)
Initially load ADMixer patch and configure line/mic mode.
A handler for accessing bytes of a word.
Definition: SFEMP3Shield.h:819
uint8_t skip(int32_t)
Skips to a duration in the track.
uint8_t skipTo(uint32_t)
Skips to a certain point in the track.
int16_t last_ms_char
Definition: FilePlayer.ino:55
Interface Driver to the VS10xx chip on the SPI.
Definition: SFEMP3Shield.h:666
void setMonoMode(uint16_t)
Set the current Stereo/Mono setting of the VS10xx output.
void setTrebleAmplitude(int8_t)
Set the current Treble Amplitude in VS10xx chip.
void loop()
Main Loop the Arduino Chip.
Definition: FilePlayer.ino:135
void stopTrack()
Gracefully close track and cancel refill.
uint8_t begin()
Initialize the MP3 Player shield.
uint8_t byte[2]
individual bytes
Definition: SFEMP3Shield.h:834
char buffer[6]
Setup the Arduino Chip&#39;s feature for our use.
Definition: FilePlayer.ino:72
#define SD_SEL
A macro to configure the SdCard Chip Select for SFEMP3SHield library.
SdFat sd
Object instancing the SdFat library.
Definition: FilePlayer.ino:47
uint32_t millis_prv
Definition: FilePlayer.ino:229
void getAudioInfo()
Display various Audio information from the VSdsp.
uint16_t getVolume()
Get the current volume from the VS10xx chip.
uint8_t disableTestSineWave()
Disable Test Sine wave.