PlaySound function (mmsystem.h) is really the simplest way how to play a wav file in a win console application. Libsndfile library is probably the most powerful free audio file library available (support for tens of audio file formats including ogg and flac), but you read raw audio data - samples, so to be able to play them, you must send them to the audio device, which is not so simple...
发布评论
评论(3)
PlaySound 函数(mmsystem.h)实际上是在 win 控制台应用程序中播放 wav 文件的最简单方法。 Libsndfile 库可能是可用的最强大的免费音频文件库(支持数十种音频文件格式,包括 ogg 和 flac),但是您读取原始音频数据 - 样本,因此为了能够播放它们,您必须将它们发送到音频装置,没那么简单……
PlaySound function (mmsystem.h) is really the simplest way how to play a wav file in a win console application. Libsndfile library is probably the most powerful free audio file library available (support for tens of audio file formats including ogg and flac), but you read raw audio data - samples, so to be able to play them, you must send them to the audio device, which is not so simple...
您应该能够使用 windows.h,有一个函数的工作原理如下:
You should be able to use windows.h, there's a function that works like this:
如果我没记错的话,人们说过 libsndfile 是处理 WAV 文件的简单方法。
If I recall correctly, people have said that libsndfile is a simple way to handle WAV files.