Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: HttpServer_snapshot_mbed-os
EasyDec_WavCnv2ch.h
00001 /* mbed EasyDec_WavCnv2ch Library 00002 * Copyright (C) 2017 dkato 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 /**************************************************************************//** 00018 * @file EasyDec_WavCnv2ch.h 00019 * @brief wav 00020 ******************************************************************************/ 00021 #ifndef __EASY_DEC_WAV_CNV_2CH_H__ 00022 #define __EASY_DEC_WAV_CNV_2CH_H__ 00023 00024 #include "EasyDecoder.h" 00025 00026 /** A class to communicate a EasyDec_WavCnv2ch 00027 * 00028 */ 00029 class EasyDec_WavCnv2ch : public EasyDecoder { 00030 public: 00031 00032 static inline EasyDecoder* inst() { return new EasyDec_WavCnv2ch; } 00033 00034 /** analyze header 00035 * 00036 * @param p_title title tag buffer 00037 * @param p_artist artist tag buffer 00038 * @param p_album album tag buffer 00039 * @param tag_size tag buffer size 00040 * @param fp file pointer 00041 * @return true = success, false = failure 00042 */ 00043 virtual bool AnalyzeHeder(char* p_title, char* p_artist, char* p_album, uint16_t tag_size, FILE* fp); 00044 00045 /** get next data 00046 * 00047 * @param buf data buffer address 00048 * @param len data buffer length 00049 * @return get data size 00050 */ 00051 virtual size_t GetNextData(void *buf, size_t len); 00052 00053 /** get channel 00054 * 00055 * @return channel 00056 */ 00057 virtual uint16_t GetChannel(); 00058 00059 /** get block size 00060 * 00061 * @return block size 00062 */ 00063 virtual uint16_t GetBlockSize(); 00064 00065 /** get sampling rate 00066 * 00067 * @return sampling rate 00068 */ 00069 virtual uint32_t GetSamplingRate(); 00070 00071 private: 00072 FILE * wav_fp; 00073 uint32_t music_data_size; 00074 uint32_t music_data_index; 00075 uint16_t channel; 00076 uint16_t block_size; 00077 uint32_t sampling_rate; 00078 }; 00079 00080 #endif
Generated on Wed Jul 13 2022 05:33:36 by
