从流播放MP3 [英] Play MP3 from stream

查看:203
本文介绍了从流播放MP3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有什么办法使用VB.NET或C#直接从内存流(没有任何临时文件)播放MP3?或从SQLCe数据库播放?

Is there any way to play MP3 directly from a memory stream (without any temp. files) using VB.NET or C#? or play from SQLCe database?

感谢

推荐答案

建议您尝试 Mp3Sharp 。它是一个JavaLayer的端口,它是用C#编写的。我目前使用它和SlimDX播放ShoutCast Mp3流。到目前为止,它工作得很好。
有一个Mp3Stream类,用于读取流并返回预定数量的PCM字节。您可以将这些字节写入DirectSound缓冲区以供播放。

I'll suggest you try Mp3Sharp. It is a port of JavaLayer and it is written in C#. I am currently using it and SlimDX to play ShoutCast Mp3 streams. So far it works very well.
There is an Mp3Stream class which you use to read the stream and return a predetermined number of PCM bytes. You can write those bytes to a DirectSound buffer for playback if you wish.

这篇关于从流播放MP3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆