modified for changes

Dependents:   AppBoard_Waveplayer

Fork of wave_player_appbd by jim hamblen

Revision:
5:bf4a8feb30b9
Parent:
3:9681894c42cb
--- a/wave_player.cpp	Tue Mar 03 19:51:08 2015 +0000
+++ b/wave_player.cpp	Thu Mar 05 19:45:11 2015 +0000
@@ -72,11 +72,8 @@
   fread(&chunk_id,4,1,wavefile);
   fread(&chunk_size,4,1,wavefile);
   while (!feof(wavefile)) {
-    if(stop){
-        if(verbosity)
-            printf("Music Player stopped.");
-        break;
-    }
+    printf("Starting loop\n");
+    
     if (verbosity)
       printf("Read chunk ID 0x%x, size 0x%x\n",chunk_id,chunk_size);
     switch (chunk_id) {
@@ -138,6 +135,11 @@
 // while 16 and 32 bit wave files use signed data
 //
         for (slice=0;slice<num_slices;slice+=1) {
+          
+          if(stop){
+            printf("Music Player stopped.\n");
+            break;
+            }
           fread(slice_buf,wav_format.block_align,1,wavefile);
           if (feof(wavefile)) {
             printf("Oops -- not enough slices in the wave file\n");