如何使用它的API为另一个应用程序制作声音应用程序? [英] How do I make a sound app for a another app using it's API?

查看:104
本文介绍了如何使用它的API为另一个应用程序制作声音应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



有一款适用于iOS和Android的应用程序。这个程序基本上是一个飞行模拟器。模拟器背后的开发团队意识到,由于他们只有有限的时间(和资源),他们会为他们的模拟器应用程序发布一个API,以便那些知道它的粉丝群编码的人可以利用API制作第三方应用程序,这将很多社区的功能请求没有太多(或任何)来自实际开发团队的工作。



现在我也想做出贡献。由于声音包使用的飞行模拟器用于他们所有的飞机(这是非常不现实的)。由于我可以访问不同飞机的几个不同的声音包,我认为我会使用他们的API获取信息,如襟翼位置的变化,起落架上升/下降等,并播放我的应用程序的声音,这将有更新的声音包。



所以我只是想知道,

1.我使用什么编程语言?我在想C#,但我很乐意接受建议。

2.如何在3D环境中播放声音?例如,如果我靠近发动机,如果我离发动机更远,音量会更大,更小。

3.如何在C#中混合各种声音文件?比如发动机听起来有所不同,当它达到20%而不是50%时它们应该是两者之间的平滑过渡。



谢谢



我尝试了什么:



我正在寻找如何在3D环境中播放声音。

Hey everyone,

There is an app which works on both iOS and android. This app is basically a flight simulator. The development team behind the simulator realized that since they have limited time (and resources), they would release an API for their simulator app so that those who knew coding from it's fanbase could utilize the API to make third party apps which would a lot of the community's feature requests without much (or any) work from the actual development team.

Now I wanted to contribute as well. Since the sound pack the flight sim used was used for all of their aircraft (which is extremely unrealistic). Since I have access to a couple of different sound packs for different aircraft, I thought that I’d use their API to get information like changes in flaps position, landing gear up/down etc and play the sounds from my app which would have the newer sound packs.

So I just wanted to know,
1. What programming language do I use? I was thinking of C# but am open to suggestions.
2. How do I make the sounds play in a 3D environment? For example, If I’m close to the engine, the volume is louder and lesser if I’m farther from the engine and so on.
3. How do I mix various sound files in C#? like the engine sounds different when it's at 20% compared to 50% and their should be a smooth transition between the two.

Thanks

What I have tried:

I'm looking for how to play the sounds in a 3D environment.

推荐答案

所有这些问题都要由API本身回答,我们对此一无所知。

All of these questions are to be answered by the API itself, and we have no idea about it.
引用:

我使用什么编程语言?我在想C#,但我很乐意接受建议。

What programming language do I use? I was thinking of C# but am open to suggestions.

他们支持哪些语言?既然你已经标记了Xamarin和Monogame,我认为C#就是这种情况。

What languages do they support? Since you have tagged Xamarin and Monogame, I assume C# is the case.

引用:

如何让声音在3D环境中播放?例如,如果我靠近发动机,如果我离发动机更远,那么音量会更大,更小。

How do I make the sounds play in a 3D environment? For example, If I’m close to the engine, the volume is louder and lesser if I’m farther from the engine and so on.

同样,API设计将涵盖如何知道物体的接近度或XYZ空间中的坐标。然后,您需要捕获它们并在它们上面设置一些其他字段和值,以控制声音的生成方式。

Again, that will be covered in the API design as to how to know the proximity of the object or the coordinates in the XYZ space. You would then need to capture them and set some other fields and values on top of them, to control how the sound is being generated.

引用:

如何在C#中混合各种声音文件?比如引擎听起来不同,当它达到20%而不是50%时它们应该是两者之间的平滑过渡。

How do I mix various sound files in C#? like the engine sounds different when it's at 20% compared to 50% and their should be a smooth transition between the two.

1:一起运行它们。

2.将它们合并到一个单独的文件中然后播放它们。



在大多数情况下,我希望引擎本身可以使用音频库我控制如何以及何时播放声音。独自完成这一切并不是一个好方法,让引擎处理它会更好 - 完全取决于API的结构和设计。



大多数时候都有文档,示例代码或示例来帮助您了解API的工作原理。您需要查阅这些文档以了解如何执行此操作。

1: Run them all together.
2. Merge them into a separate file and then play them.

In most cases, I would expect an Audio library to be available in the engine itself that lets me control how and when to play the sound. Doing that all by myself is not going to be a good approach and letting engine take care of it would be better — entirely upto the structure and design of the API.

Most of the times there are documentations, example codes or samples to help you understand how the API works. You need to consult those documentations to learn how you would do that.


这篇关于如何使用它的API为另一个应用程序制作声音应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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