cj wave
Dependents: USBMSD_SD_HelloWorld_FRDM-KL25Z
Fork of wave_player by
Revision 2:8bc1cfb9ea78, committed 2013-05-01
- Comitter:
- cstevens
- Date:
- Wed May 01 10:39:39 2013 +0000
- Parent:
- 1:acc3e18e77ad
- Commit message:
- cj wave
Changed in this revision
wave_player.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r acc3e18e77ad -r 8bc1cfb9ea78 wave_player.cpp --- a/wave_player.cpp Tue Jan 18 03:57:27 2011 +0000 +++ b/wave_player.cpp Wed May 01 10:39:39 2013 +0000 @@ -128,6 +128,7 @@ // note that from what I can find that 8 bit wave files use unsigned data, // while 16 and 32 bit wave files use signed data // +if(verbosity) wait(5); for (slice=0;slice<num_slices;slice+=1) { fread(slice_buf,wav_format.block_align,1,wavefile); if (feof(wavefile)) { @@ -141,7 +142,7 @@ for (channel=0;channel<wav_format.num_channels;channel++) { switch (wav_format.sig_bps) { case 16: - if (verbosity) + if (verbosity && slice %1000 ==0) printf("16 bit channel %d data=%d ",channel,data_sptr[channel]); slice_value+=data_sptr[channel]; break; @@ -172,7 +173,7 @@ } dac_data=(short unsigned)slice_value; if (verbosity) - printf("sample %d wptr %d slice_value %d dac_data %u\n",slice,DAC_wptr,(int)slice_value,dac_data); + printf("sample %d wptr %d slice_value %d dac_data %u\n\r",slice,DAC_wptr,(int)slice_value,dac_data); DAC_fifo[DAC_wptr]=dac_data; DAC_wptr=(DAC_wptr+1) & 0xff; while (DAC_wptr==DAC_rptr) {