- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我知道如何在 ActionScript 3中录制音频。但是是否可以从 ActionScript 的最终声音文件中删除某些内容?
我的用例是,用户可以跳到声音文件中的某个特定点(我可以管理该点)并从那里开始录音(基本上覆盖了文件的其余部分)。
在 ActionScript 3中是否可行?
谢谢。
更新:
这是我使用过的代码,它可以正常工作,但是旧唱片却被淘汰了。我不知道为什么“selectedTime”是用户在波形图示中选择的时间的毫秒值; 44100是我的采样率。
existingByte = new ByteArray();
var extract:Number = Math.floor ((selectedTime)*44.1);
sound.extract(existingByte, extract);
mic.recordData(existingByte);
// in the mic class:
public function recordData(existingByteArray:ByteArray=null):void {
if(existingByteArray == null) {
raw = new ByteArray();
} else {
raw = existingByteArray;
raw.position = raw.length;
}
mic.addEventListener(SampleDataEvent.SAMPLE_DATA, dataHandler);
}
private function dataHandler(event:SampleDataEvent):void {
try {
raw.writeBytes(event.data);
} catch(e) {
this.stopRecording();
}
}
最佳答案
是。当您从音频流中接收字节时,会将这些字节附加到主缓冲区中。如果您想进行录音等打孔。您需要知道要冲入的主缓冲区的偏移量。因此,与其从头开始写入缓冲区,不如从用户单击的偏移量写入缓冲区。您必须将鼠标指针与主缓冲区中的偏移量相关联。然后,当您收到新的音频时,只需覆盖该缓冲区中的值即可。如果您想要打孔,那么它只会覆盖音频的一小部分。您将需要在主缓冲区中的一个端点也要停止写入新数据。用户可以突出显示音频的一部分以说出进/出点。
您必须将ByteArrays用于两个缓冲区。您可以使用Sound.extract()从Sound中提取原始字节。其他原始音频来源也可以在这里应用:
var master : ByteArray; // assume this is loaded with some audio
public function punchIn( startLocation : index, sound : Sound ) : void {
sound.extract( master, sound.bytesTotal, startLocation );
}
关于flash - 在 ActionScript 中剪切声音,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8897154/
我有 2 个视频文件(input.mp4,leadout.mp4)和一个图像(watermark.png)。我需要将第一个视频剪切到 54 秒,添加水印,然后将其与第二个视频合并。 我实现了这个调用
在 VBA 中,您可以在剪切和粘贴后直接进行复制和粘贴。我之所以问,是因为 for 循环中的 If 语句需要剪切一行数据,然后直接在下面复制该行。当我运行代码时,它会执行该剪切,但不会执行副本。我在网
我想在剪切/粘贴事件触发后调用函数。 例如,当用户通过键盘或鼠标(带有上下文菜单)在编辑器中剪切/粘贴时,我想计算用户输入的字符数。 用户执行剪切/粘贴后有什么方法可以调用我们自己的函数吗? 最佳答案
抱歉,标题不准确,但实际上我正在尝试简化方法: Docker service ls 变成这个: Docker service ls cutted 尝试使用-f,但不起作用。 也许有一些grep / s
我有一个带有三角形的彩色噪声正方形。 现在,我希望多边形像圣诞节的“ cookies 切割器”一样减少这种噪音。导致被多边形路径包围的三角形噪声。 如何裁剪与多边形边框重叠的所有像素,然后将其另存为
我正在 Prolog 中开发一个谓词,它有可能在它结束之前终止。 出于这个原因,我正在寻找类似于 return; 的命令。 (C++)。我用了 cut !但我怀疑它的字面意思以及它是否确实做了什么re
我的代码如下所示: ServiceHandler sh = new ServiceHandler(); // Making a request to url and g
在 Linux(Raspbian 发行版)中,我试图提取文件名的日期部分,当我直接将其输入终端时,该文件名有效(见下文)。 $ file1="access_point20140821.csv" $ e
我正在使用 vuetify,我想制作一个可滚动的 stepper在对话框中。 这是一个代码笔 https://codepen.io/anon/pen/OqWQdy 我在 v-stepper-items
我有一个小测试站点,其中一个 div 的宽度减小到 50%,当我们单击按钮时另一个 div 出现。这是我的 codepen 当您单击该按钮时,图像会调整大小。因为我正在使用:background-si
我必须编写一个脚本文件来剪切以下列并将其粘贴到新 .arff 文件中同一行的末尾。我想文件类型无关紧要。 当前文件: 63,male,typ_angina,145,233,t,left_vent_hy
如何拦截此类事件? 当用户尝试将一些文本粘贴到我的 EditText 中时,我需要添加一些逻辑我知道我可以使用 TextWatcher 但这个入口点对我不利,因为我只在粘贴的情况下需要拦截,而不是每次
我有一个简单的自定义无边框 NSWindow 子类,它具有圆角矩形形状。 在此窗口的内容 View 中,我添加了一个 NSScrollView。 如何让 NSScrollView 将其文档 View
所以这是我的代码,但是每次尝试剪切字符串“words”都失败了,它只是用 jsoup 收到的整个文本执行 TextView。 我只想剪切字符串的前 x 个单词。 public class main e
Action Bar Select All/Cut/Copy not showing for EditText in Alert dialog(picture 2),请帮助 编辑:代码是
如何检测 tinymce 上的右键单击删除?我通过 onPaste 事件检测到粘贴事件,但我卡在剪切删除和复制上。我知道有 onContextMenu 事件,但似乎没有保存菜单项的函数或变量。 有什么
我有两个 JTextAreas 并且想要实现剪切、复制和粘贴菜单项。我知道 JTextArea.cut 和其他方法,但无法弄清楚如何确定用户在何处(在哪个 JTextArea 中)选择了文本和/或放置
我想在两侧“剪切”我的页面,如下所示: http://i.stack.imgur.com/ngZrp.jpg 演示:https://jsfiddle.net/r2g0eyxf/3/ #left {
我有一个绝对位于另一个元素之上的元素。问题是背景元素有一点 JS 可以根据鼠标的移动在 Y 轴上旋转。不幸的是,我在 Safari 中发现了一个在 Firefox 或 Chrome 中没有出现的问题。
我正在编写一个脚本,在该脚本中,我采用名片设计并使用它生成一张纸,上面有十张卡片,以匹配打印临时卡片的模板。这里最棘手的部分是出血;它们会在中间重叠,所以我需要为每个都制作剪贴蒙版。 我想出了一个系统
我是一名优秀的程序员,十分优秀!