Easy playback library for PwmOutSpeaker.

Committer:
dkato
Date:
Thu Jul 06 04:42:29 2017 +0000
Revision:
0:41ab76b22961
first commit

Who changed what in which revision?

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