如何在C#中分割音频文件? [英] How to segment audio file in C#?

查看:600
本文介绍了如何在C#中分割音频文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道如何开始音频文件的分割。我想将3秒的音频信号分成120个部分,每个部分为25毫秒。



有人回答了我的问题吗?如果您有,那么我想提前感谢。帮我plz ...

I don't know how to start segmentation for audio file. I want to slice audio signal of 3 Sec into 120 parts each & every segment of 25 millisecond.

Anybody have answer to my question? If you have then I want to thank in advance. Help me plz...

推荐答案

我用这段代码修剪音频信号



I use this code for trim audio signal

private void button1_Click(object sender, EventArgs e)
        {
            string ifile = @"E:\Temp\a1.wav";
            string ofile = @"E:\Temp\a3.wav";

            Process p = new Process();
            p.StartInfo.UseShellExecute = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.RedirectStandardError = true;
            p.StartInfo.FileName = "C:\\Program Files (x86)\\sox-14-4-1\\sox.exe ";
            //p.StartInfo.Arguments = ifile + " " + ofile + " silence 1 0.1 1% 0.1 1%";
            p.StartInfo.Arguments = ifile + " " + ofile + " silence 1 0.1 1% -1 0.1 1%";

            //sox in.wav out4.wav silence 1 0.1 1% -1 0.1 1%
            //p.OutputDataReceived += process_OutputDataReceived;
            //p.ErrorDataReceived += process_ErrorDataReceived;

            p.Start();
            p.BeginErrorReadLine();
            p.BeginOutputReadLine();
        }


这篇关于如何在C#中分割音频文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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