ECE 4180
Fork of wave_player by
Diff: wave_player.cpp
- Revision:
- 2:7579a7b64408
- Parent:
- 0:62c18ade9a60
diff -r acc3e18e77ad -r 7579a7b64408 wave_player.cpp --- 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