ECE 4180

Fork of wave_player by Steve Ravet

Files at this revision

API Documentation at this revision

Comitter:
jtgt21
Date:
Mon Mar 14 17:17:20 2016 +0000
Parent:
1:acc3e18e77ad
Commit message:
commit

Changed in this revision

wave_player.cpp Show annotated file Show diff for this revision Revisions of this file
wave_player.h Show annotated file Show diff for this revision Revisions of this file
--- a/wave_player.cpp	Tue Jan 18 03:57:27 2011 +0000
+++ b/wave_player.cpp	Mon Mar 14 17:17:20 2016 +0000
@@ -44,7 +44,7 @@
 // SDcard filesystem can be hotrodded by increasing the SPI frequency it uses
 // internally.
 //-----------------------------------------------------------------------------
-void wave_player::play(FILE *wavefile)
+void wave_player::play(FILE *wavefile, int &play)
 {
         unsigned chunk_id,chunk_size,channel;
         unsigned data,samp_int,i;
@@ -134,6 +134,8 @@
             printf("Oops -- not enough slices in the wave file\n");
             exit(1);
           }
+          if(play == 0)
+          {break;}
           data_sptr=(short *)slice_buf;     // 16 bit samples
           data_bptr=(unsigned char *)slice_buf;     // 8 bit samples
           data_wptr=(int *)slice_buf;     // 32 bit samples
--- a/wave_player.h	Tue Jan 18 03:57:27 2011 +0000
+++ b/wave_player.h	Mon Mar 14 17:17:20 2016 +0000
@@ -43,7 +43,7 @@
  *
  * @param wavefile  A pointer to an opened wave file
  */
-void play(FILE *wavefile);
+void play(FILE *wavefile, int &play);
 
 /** Set the printf verbosity of the wave player.  A nonzero verbosity level
  * will put wave_player in a mode where the complete contents of the wave
@@ -57,7 +57,6 @@
  * @param v the verbosity level
  */
 void set_verbosity(int v);
-
 private:
 void dac_out(void);
 int verbosity;