连接无线电流和 MP3 解码器
Connecting RadioStream and a MP3 decoder
我正在尝试构建一个用于读取流和解码流的arduino网络收音机 我有以下两种写入和读取流的方法,需要连接,但我想不出一个好方法:
在这种方法中,我们读取无线电流并将其内容写入 32 字节缓冲区。
uint8_t buff[32];
// from the server, read them and print them:
while (true)
{
int ret = client.read(buff, sizeof(buff) / 2 );
if (ret <= 0)
break;
for(int i = 0; i < ret; i++)
{//instead of Serial write we need to do something with the contents of this buffer
Serial.write((char)buff[i]);
}
}
下一个方法从网络无线电中获取二进制流并对其进行解码:
int getMoreData(uint8_t *writeHere, int available)
{
/* TODO: write up to 'available' bytes of MP3 data
* to the location 'writeHere'. Return the actual number of bytes
* that were written
*/}
这两种方法需要相互连接,但我不确定如何连接。
谢谢!
所以基本上我在这里需要的是一个可以填充和异步读取的缓冲区。
或者换句话说,消费者和生产者以不同的速度工作。
所以对我有用的是一个标准的环形缓冲区,几乎每个平台(包括arduino(都有各种各样的实现。
相关文章:
- 错误:(-210:不支持的格式或格式组合)功能'create'中的硬件视频解码器不支持视频源
- 如何从WIC解码器确定自上而下/自下而上?
- 无法在 HEVC 解码器上设置输出类型 IMFTransform
- 连接无线电流和 MP3 解码器
- h264_cuvid编解码器未找到
- C++17 编解码器在将标准::字符串转换为标准::字符串时抛出"bad conversion"
- 如何使用 ffmpeg 将 3840 nb_samples编码为请求 1024 的编解码器
- FFMPEG:为什么当我调用av_codec_next()时,我所有的编解码器都没有显示出来
- OpenCV 检查计算机上是否安装了视频编解码器 (C++)
- FFMPEG 解码器似乎会丢帧
- 直接显示通用媒体解码器
- OpenCV:FFMPEG:编解码器 ID 12 和格式 'mp4 / MP4 不支持标记
- 带有 H264 编解码器的 libav 错误消息。"非严格单调PTS"
- C++ 文本消息解码器脚本 编译器 "expects unqualified id" 之前 if 和 else 语句
- 为什么编解码器X264/X265忽略了输入框架的PT和DTS
- C++MP3,WAV和ACC(低电平)解码器
- 使用Windows内置的MP3解码器播放音频
- 如何使用Windows内置的mp3解码器访问原始解码音频数据?
- GCC-如何使用FLV1(又名H.263)、MP3(格式和编解码器)和FLV(容器格式)编译FFMpeg
- C++跨平台MP3解码器