- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
您好,我正在使用以下代码在 Android 上录制音频
myRecorder = new MediaRecorder();
myRecorder.setAudioSource(MediaRecorder.AudioSource.MIC);
myRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
myRecorder.setAudioEncoder(MediaRecorder.AudioEncoder.AAC);
myRecorder.setAudioSamplingRate(44100);
myRecorder.setAudioEncodingBitRate(256);
myRecorder.setAudioChannels(1);
voiceFileName = getFilename();
myRecorder.setOutputFile(voiceFileName);
private String getFilename() {
String filepath = Environment.getExternalStorageDirectory().getPath();
File file = new File(filepath, "test");
if (!file.exists()) {
file.mkdirs();
}
return (file.getAbsolutePath() + "/" + System.currentTimeMillis() + ".mp3");
}
但是那个 aac(.mp3) 文件不能在 iOS 上播放。编辑
let audioFilename = getDocumentsDirectory().stringByAppendingPathComponent("whistle.mp3")
let audioURL = NSURL(fileURLWithPath: audioFilename)
let whistlePlayer:AVAudioplayer = try AVAudioPlayer(contentsOfURL: audioURL)
whistlePlayer.play()
如何在 IOS(Swift) 中播放此文件?
最佳答案
我得到的解决方案只是将扩展名更改为 .m4a 它在 ios 上工作
let audioFilename = getDocumentsDirectory().stringByAppendingPathComponent("voice.m4a")
let audioURL = NSURL(fileURLWithPath: audioFilename)
do
{
audioPlayer = try AVAudioPlayer(contentsOfURL: audioURL)
audioPlayer.delegate = self
audioPlayer.play()
}
catch{
print("filenotfound")
}
关于Android 录制的 aac(.mp3) 文件无法在 iOS 中播放,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34201702/
我是 iphone 开发人员,现在正在开发一款 mac 应用程序。这是我在 mac 平台上的第一个项目。 我必须分析歌曲文件的 BPM。我已经使用 FMOD 和 SoundTouch 库为 MP3 完
我正在尝试使用 libavcodec/ffmpeg API 以 AAC-LC、AAC-HE-V1、AAC-HE-V2 编码音频。 但是当我使用以下配置和 API 调用时。它显示“无效的 AAC 配置文
我正在尝试使以下截屏命令起作用: avconv -f alsa -ar 44100 -ac 2 -i default -acodec aac -strict experimental -ab 320k
我想使用 ffmpeg 将 mp3 转换为 aac 并将其流式传输到我的节点应用程序中的 s3。我的代码如下。现在,当我尝试将 audioCodec 用作“aac”或“libfdk-aac”时。它抛出
我设法记录了 mp3 与 VLC 2.1.5 在 MacOSX 10.9.2 通过使用这个命令: ./VLC -vvv qtsound://AppleHDAEngineInput:1B,0,1,0:1
我正在尝试将原始 PCM 转换为 aac。所以我试图通过 ffmpeg 来实现它。 我的 ffmepg 配置 --enable-cross-compile --arch=arm --cpu=armv6
您好,我出于非营利目的运行流式编码器。选择 FFMPEG 是因为它非常简单并且几乎可以完美地完成工作,但是音频会发出嘈杂的爆裂声。视频非常清晰。 ffmpeg 版本 N-86950-g1bef008
如果我有一个包含视频流和音频流的 .mp4 文件。如果我执行这个命令: ffmpeg -i input.mp4 -ss 00:00:14.000 -t 00:00:01.000 -vn -c:a li
我想将 WAV 格式的音频流编码为 AAC 格式,并将 AAC 音频流解码为 WAV。我可以使用 SharpDX 的 MediaFoundation DLL 实现吗?那我该如何使用呢? 最佳答案 也许
如果你只做 ffmpeg -i aFile.ts aFile.m4a 会发生什么?而不是 ffmpeg -i aFile.ts -codec copy aFile.m4a ,当 TS 文件只包含一个流
我正在开发一个 MP3 播放器,我想添加 radio 功能。几乎所有关于此的 StackOverflow 帖子都来自 2010 年。这对于这个主题来说非常烦人,因为我找不到解决方案。我知道这是商业解决
我可能听起来太菜鸟请原谅我。当我在 Matlab 中使用 读取 .AAC 音频文件时有声读物 函数输出是一个 256000x6 矩阵。我怎么知道每列的内容是什么? filename = 'sample
有什么提示吗?我正在尝试:http://www.jplayer.org/结果不佳。 错误的结果意味着它不起作用,也完全没有错误。 因此,我正在寻找一种支持.aac文件的替代方案。 最佳答案 试试这个
我确实有一个非常特殊的问题,我希望我能找到答案。 我正在尝试使用 NAudio 库从 URL(在线流广播,例如 live.noroc.tv:8000/radionoroc.aacp)读取 AAC 流并
我目前正在尝试开发视频/音频编码管道。 我的目标是对包含 h264 视频轨道和 AAC 音频轨道的 mp4 文件进行编码。这些文件应该一个接一个地播放,中间没有任何间隙。 目前我正在使用 ffmpeg
我目前正在使用RTP传输音频(8kHz的AAC-HBR)和视频(H264)。两种供稿都可以单独正常工作,但是放在一起时,它们的同步速度非常快(不到15秒)。 我不确定如何增加音频RTP报头上的时间戳,
我正在尝试将3gpp中打包的AAC-LC数据编码为RTP。我已经通过了rfc 3640,但我仍然不知道从哪里开始。我将在AAC数据中找到什么?如果我没记错的话,前40个字节将是MP4 header ,
我正在处理具有以下元数据的 M4a 文件: Metadata: major_brand : M4A minor_version : 0 compatible_bra
在使用 FFMPEG android java 库时发生以下异常的视频播放速度(使视频变慢)。 [aac @ 0x416c26f0] The encoder 'aac' is experimental
我无法让 FFmpeg 将 AAC 文件转换为 HLS block : cat file.m4a | ffmpeg -y -i pipe:0 -c:a libmp3lame -q:a 0 -map 0
我是一名优秀的程序员,十分优秀!