Easy playback library for AUDIO_GRBoard.

Dependents:   GR-PEACH_Audio_WAV_PwmOut GR-Boards_Audio_WAV

Committer:
dkato
Date:
Tue Jul 24 08:45:30 2018 +0000
Revision:
2:6c46c61630b3
Parent:
0:9956e2ed09da
Add PwmOutSpeaker to output

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dkato 0:9956e2ed09da 1 /* mbed EasyDecoder Library
dkato 0:9956e2ed09da 2 * Copyright (C) 2017 dkato
dkato 0:9956e2ed09da 3 *
dkato 0:9956e2ed09da 4 * Licensed under the Apache License, Version 2.0 (the "License");
dkato 0:9956e2ed09da 5 * you may not use this file except in compliance with the License.
dkato 0:9956e2ed09da 6 * You may obtain a copy of the License at
dkato 0:9956e2ed09da 7 *
dkato 0:9956e2ed09da 8 * http://www.apache.org/licenses/LICENSE-2.0
dkato 0:9956e2ed09da 9 *
dkato 0:9956e2ed09da 10 * Unless required by applicable law or agreed to in writing, software
dkato 0:9956e2ed09da 11 * distributed under the License is distributed on an "AS IS" BASIS,
dkato 0:9956e2ed09da 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
dkato 0:9956e2ed09da 13 * See the License for the specific language governing permissions and
dkato 0:9956e2ed09da 14 * limitations under the License.
dkato 0:9956e2ed09da 15 */
dkato 0:9956e2ed09da 16
dkato 0:9956e2ed09da 17 #ifndef __EASY_DECODER_H__
dkato 0:9956e2ed09da 18 #define __EASY_DECODER_H__
dkato 0:9956e2ed09da 19
dkato 0:9956e2ed09da 20 #include "mbed.h"
dkato 0:9956e2ed09da 21
dkato 0:9956e2ed09da 22 class EasyDecoder {
dkato 0:9956e2ed09da 23 public:
dkato 0:9956e2ed09da 24
dkato 0:9956e2ed09da 25 virtual ~EasyDecoder(){}
dkato 0:9956e2ed09da 26
dkato 0:9956e2ed09da 27 /** analyze header
dkato 0:9956e2ed09da 28 *
dkato 0:9956e2ed09da 29 * @param p_title title tag buffer
dkato 0:9956e2ed09da 30 * @param p_artist artist tag buffer
dkato 0:9956e2ed09da 31 * @param p_album album tag buffer
dkato 0:9956e2ed09da 32 * @param tag_size tag buffer size
dkato 0:9956e2ed09da 33 * @param fp file pointer
dkato 0:9956e2ed09da 34 * @return true = success, false = failure
dkato 0:9956e2ed09da 35 */
dkato 0:9956e2ed09da 36 virtual bool AnalyzeHeder(char* p_title, char* p_artist, char* p_album, uint16_t tag_size, FILE* fp) = 0;
dkato 0:9956e2ed09da 37
dkato 0:9956e2ed09da 38 /** get next data
dkato 0:9956e2ed09da 39 *
dkato 0:9956e2ed09da 40 * @param buf data buffer address
dkato 0:9956e2ed09da 41 * @param len data buffer length
dkato 0:9956e2ed09da 42 * @return get data size
dkato 0:9956e2ed09da 43 */
dkato 0:9956e2ed09da 44 virtual size_t GetNextData(void *buf, size_t len) = 0;
dkato 0:9956e2ed09da 45
dkato 0:9956e2ed09da 46 /** get channel
dkato 0:9956e2ed09da 47 *
dkato 0:9956e2ed09da 48 * @return channel
dkato 0:9956e2ed09da 49 */
dkato 0:9956e2ed09da 50 virtual uint16_t GetChannel() = 0;
dkato 0:9956e2ed09da 51
dkato 0:9956e2ed09da 52 /** get block size
dkato 0:9956e2ed09da 53 *
dkato 0:9956e2ed09da 54 * @return block size
dkato 0:9956e2ed09da 55 */
dkato 0:9956e2ed09da 56 virtual uint16_t GetBlockSize() = 0;
dkato 0:9956e2ed09da 57
dkato 0:9956e2ed09da 58 /** get sampling rate
dkato 0:9956e2ed09da 59 *
dkato 0:9956e2ed09da 60 * @return sampling rate
dkato 0:9956e2ed09da 61 */
dkato 0:9956e2ed09da 62 virtual uint32_t GetSamplingRate() = 0;
dkato 0:9956e2ed09da 63
dkato 0:9956e2ed09da 64 };
dkato 0:9956e2ed09da 65
dkato 0:9956e2ed09da 66 #endif