Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.
Posted
Updated 4-Nov-17 7:59am
v2

1 solution

All of these questions are to be answered by the API itself, and we have no idea about it.
Quote:
What programming language do I use? I was thinking of C# but am open to suggestions.
What languages do they support? Since you have tagged Xamarin and Monogame, I assume C# is the case.
Quote:
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.
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.
Quote:
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: 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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900