添加沉默所记录的音频文件的最后 [英] Adding silence to the end of a recorded audio file

查看:163
本文介绍了添加沉默所记录的音频文件的最后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,我让用户不再录制自己的声音的持续时间超过30秒。一旦他们完成记录他们的声音,我抢他们的音频的持续时间。我跑这个快速数学(SixtySeconds-TheirAudioDuraion)= TimeNeededToFill。基本上,我需要在最后一个precise 1分钟轨道结束。一些一部分是实际的音频,余数是无声音频。即时通讯目前使用AVAudioPlayer做我所有的录音的。有没有做到这一点对一个程序化的方式有些蛮力砍,我开始恶补沉默音轨文件一起创建一个单独的文件?

Currently I'm allowing user to record their own voice for a duration no longer than 30 seconds. Once they are finished recording their audio, I grab the duration of their audio. I run this quick math (SixtySeconds-TheirAudioDuraion) = TimeNeededToFill. Basically I need to end up with a precise 1-minute track in the end. Some portion of which is actual Audio, the remainder is Silent Audio. Im currently using AVAudioPlayer to do all of my audio recording. Is there a programatic way to accomplish this vs. some brute-force hack where I start cramming silent audio track files together to create a single file?

简单的光彩和需要将AP preciated。

Simple brilliance needed and would be appreciated.

我所能来所有。

推荐答案

我早就已经记沉默60秒的记录,它添加到用户的记录,然后修剪的总长度为60秒。

I would have a 60 second recording of silence already "recorded", append that to the users recording, and then trim the total length to 60 seconds.

这太问题<一href=\"http://stackoverflow.com/questions/4649918/avaudiorecorder-avaudioplayer-append-recording-to-file\">avaudiorecorder-avaudioplayer-append-recording-to-file必须在Siddarth的回答追加声音文件提供一些参考。

This SO question avaudiorecorder-avaudioplayer-append-recording-to-file has some references to appending sound files in Siddarth's answer.

这太问题修剪音频与 - IOS 大约有微调的声音文件的信息。

This SO question trim-audio-with-ios has information about trimming sound files.

这篇关于添加沉默所记录的音频文件的最后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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