Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

play_serialflash_raw.h 2.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Audio Library for Teensy 3.X
  2. * Copyright (c) 2014, Paul Stoffregen, paul@pjrc.com
  3. * Modified to use SerialFlash instead of SD library by Wyatt Olson <wyatt@digitalcave.ca>
  4. *
  5. * Development of this audio library was funded by PJRC.COM, LLC by sales of
  6. * Teensy and Audio Adaptor boards. Please support PJRC's efforts to develop
  7. * open source software by purchasing Teensy or other PJRC products.
  8. *
  9. * Permission is hereby granted, free of charge, to any person obtaining a copy
  10. * of this software and associated documentation files (the "Software"), to deal
  11. * in the Software without restriction, including without limitation the rights
  12. * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. * copies of the Software, and to permit persons to whom the Software is
  14. * furnished to do so, subject to the following conditions:
  15. *
  16. * The above copyright notice, development funding notice, and this permission
  17. * notice shall be included in all copies or substantial portions of the Software.
  18. *
  19. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  25. * THE SOFTWARE.
  26. */
  27. #ifndef play_serial_raw_h_
  28. #define play_serial_raw_h_
  29. #include <AudioStream.h>
  30. #include <SerialFlash.h>
  31. class AudioPlaySerialflashRaw : public AudioStream
  32. {
  33. public:
  34. AudioPlaySerialflashRaw(void) : AudioStream(0, NULL) { begin(); }
  35. void begin(void);
  36. bool play(const char *filename);
  37. void stop(void);
  38. bool isPlaying(void) { return playing; }
  39. uint32_t positionMillis(void);
  40. uint32_t lengthMillis(void);
  41. virtual void update(void);
  42. private:
  43. SerialFlashFile rawfile;
  44. uint32_t file_size;
  45. volatile uint32_t file_offset;
  46. volatile bool playing;
  47. };
  48. #endif