s

Fork of wave_player by Steve Ravet

Revision:
2:44a41c9ff2d4
Parent:
1:acc3e18e77ad
diff -r acc3e18e77ad -r 44a41c9ff2d4 wave_player.h
--- a/wave_player.h	Tue Jan 18 03:57:27 2011 +0000
+++ b/wave_player.h	Mon May 02 08:00:12 2016 +0000
@@ -1,5 +1,5 @@
 #include <mbed.h>
-
+ 
 typedef struct uFMT_STRUCT {
   short comp_code;
   short num_channels;
@@ -8,8 +8,8 @@
   short block_align;
   short sig_bps;
 } FMT_STRUCT;
-
-
+ 
+ 
 /** wave file player class.
  *
  * Example:
@@ -31,20 +31,20 @@
  * @endcode
  */
 class wave_player {
-
+ 
 public:
 /** Create a wave player using a pointer to the given AnalogOut object.
  *
  * @param _dac pointer to an AnalogOut object to which the samples are sent.
  */
-wave_player(AnalogOut *_dac);
-
+wave_player(AnalogOut *_dac, PwmOut *_pwm);
+ 
 /** the player function.
  *
  * @param wavefile  A pointer to an opened wave file
  */
 void play(FILE *wavefile);
-
+ 
 /** 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
  * file are echoed to the screen, including header values, and including
@@ -57,16 +57,15 @@
  * @param v the verbosity level
  */
 void set_verbosity(int v);
-
+ 
 private:
 void dac_out(void);
 int verbosity;
 AnalogOut *wave_DAC;
+PwmOut *wave_PWM;
 Ticker tick;
 unsigned short DAC_fifo[256];
 short DAC_wptr;
 volatile short DAC_rptr;
 short DAC_on;
-};
-
-
+};
\ No newline at end of file