简体   繁体   English

在八度/ matlab中从wavwrite转换为audiowrite的语法问题

[英]Syntax issue with converting over from wavwrite to audiowrite in octave / matlab

In Octave 3.8.1 I'm able to export a stereo wave file using the command belowOctave 3.8.1 中,我可以使用以下命令导出立体声波形文件

wavwrite([w1(:) w2(:)],44100,16,'/tmp/testfile.wav');

I'm trying to get it to work with audiowrite using octave 4.0 see below but I get a audiowrite: wrong argument name error我正在尝试使用八度音程 4.0 使其与音频写入一起使用,请参见下文,但我收到音频写入:错误的参数名称错误

audiowrite('/tmp/testfile2.wav',[w1(:) w2(:) w3(:) w4(:)],44100,16)

and

audiowrite('/tmp/testfile2.flac',[w1(:) w2(:) w3(:) w4(:)],44100,16)

It says audiowrite can have up to 256 channels am I incorrect about this?它说 audiowrite 最多可以有 256 个通道,我对此有误吗?

Thanks谢谢

Try:尝试:

audiowrite('/tmp/testfile2.wav',[w1(:) w2(:) w3(:) w4(:)],44100,'BitsPerSample',16) 

or或者

audiowrite('/tmp/testfile2.wav',[w1(:) w2(:) w3(:) w4(:)],44100). 

16 Bits per sample is default.每个样本 16 位是默认值。 Check out the documentation here for more information.查看此处的文档以获取更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM