简体   繁体   English

在Android上使用Jmusic混合音频

[英]Mixing audio on android with Jmusic

I have been working on a music app for android devices for the past few months. 在过去的几个月中,我一直在为Android设备开发音乐应用。 I have written a considerable amount of code so far. 到目前为止,我已经编写了很多代码。 However, I have been stuck for almost a month on the mixing part of the code. 但是,我在代码的混合部分停留了将近一个月的时间。 Since Android does not offer a way to mix audio (merge sounds into one file so that they play at the same time) I decided to add the Jmusic library to the project and use it to manipulate audio files. 由于Android没有提供混合音频的方法(将声音合并到一个文件中,以便它们可以同时播放),因此我决定将Jmusic库添加到项目中,并使用它来处理audio文件。 Unfortunately, every time I try to read an audio file from the sdcard , the app crashes. 不幸的是,每次我尝试从sdcard读取音频文件时,应用程序都会崩溃。 I have been looking for resource online to solve this problem, but I can't find a good one. 我一直在寻找在线资源来解决此问题,但找不到一个好的资源。 I am thinking that maybe Android does not support the use of other libraries . 我在想,也许Android不支持使用其他libraries Can any of you guys suggest an alternative solution if that's the case. 如果是这样,你们可以建议其他解决方案吗? An example code (with explanation) using Java would be greatly appreciated. 使用Java的示例code (带有解释)将不胜感激。 What I am mainly doing is declaring a float array (data) and reading the audio file as such 我主要要做的是声明一个float array (数据)并像这样读取音频文件

     data = Read.Audio("string that holds the path of the file on the sd card");

我认为android不支持javaSE环境。在编译过程之后,android生成了dalvik代码,而java的字节代码却明显不同。

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

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