Is it possible to get the audio output from an android system into Unity? So that I can get audio data running from other apps on the phone into the unity system for use.
I've tried searching, and the only thing I can find is about android visualizer, which would be fine, as I don't need to record the audio, just format it into a couple of floats.
However, I have no idea how to implement visualizer as a plugin for unity to use, nor if there is any other way to get audio. People say it is the only way to get audio from android speakers, but I cannot find any aid or help as how to implement it into unity (other than people writing "make a plugin").
If visualizer cannot be implemented into Unity, is there any other way (apart from recording with the microphone) to get audio data from system output.
To clarify, I do not need to record audio, so it does not need to be high quality, I only need basic analysis from it so I can get volume and/or pitch.
Related
I have a game in Unity3D, In this game I imported some audio files that are songs, I composed them in a program called Bosca Ceoil, save it as .wav, then, I imported and edited them in Audacity, as the same, saved them as .wav, and finally imported them to Unity.
The thing here is that these audios sound distorted, like if they were to loud and kind of a robotic effect.
So I turned off the Doppler effect in the Audio Source and also in the project settings.
Its a little weird because this audios only gets distorted when I build it in my Android device, in my computer, in the editor works fine.
Also, the distorted parts are only specific ones, curiosly the parts with drums dont get distorted, all the others yes do, and this is very strange because the distorted parts are not loud.
Unity does not have a built-in compressor, which means any waveforms that add up to over 1 will distort. (This will invariably happen if you are importing high-quality and/or loud clips.)
You can use the Audio Manager in Unity’s Editor to tweak the maximum Volume of all sounds played in the scene.
but if it works in the editor it could be the below
If you are experiencing issues with sound quality, volume, distortion etc and you are running Android 5.x Lollipop please try disabling 'Nuplayer' from the developer settings. This is an experimental player Google introduced to Android and is known to cause some issues.
Is there any way in c#/.net of recording the current audio being played? I've searched a lot on the internet but the only result I could find is recording using a microphone.
I dont want to record using microphone input, I want to record what is being played on the computer when I click a record button.
Thanks
You have two options here:
Hardware loopback device - virtual "Stereo Mix" audio device, which acts as a regular audio capture device and in the same time produces a copy of mixed audio feed played through default audio output device of the system. Since such device shows up as real audio input device, you can use standard APIs, libraries and even exitsing applications to record from such device.
Programmatic access to a virtual loopback device as if it was microphone-like device. API on the background will duplicate played audio content and make it available for reading back as it plays. The good news is that you can access the mixed audio feed for device of your interest.
Both options are described in detail in Loopback Recording article on MSDN and available via standard audio APIs, specifically WASAPI.
For C# development you are likely to use a wrapper like NAudio.
For option 1 you will find quite a few questions on StackOverflow, and for the other option the keyword is AUDCLNT_STREAMFLAGS_LOOPBACK.
The only way to be able to receive data from another application is if the developer provides an access point, normally through some SDK, API, or other means. Without this, there is no way for your application code to receive the bytes from the other application.
The reason a microphone works is because it is receiving the sound output bytes from the application and sending those soundwave bytes back into your PC to render and output the sound. Since you have access to these bytes from the microphone you are able to capture the sound.
See if there is an API or an SDK from the developer of the application you are trying to get sound from.
Hi I'm making a game about recording in-game audio, but all I can do is recording with internal microphone, the default input audio device. I try to see the list of devices in Unity with Microphone.devices, but depend of my Windows configurated devices, I need a solution to work in any computer. Maybe something related to FMOD custom DSP, faking a audio card or some solution in Unity API, I need a north. How I'm using the code:
myAudioClip = Microphone.Start ( null, false, 10, 44100 );
To save a audio file I'm using that script: https://gist.github.com/darktable/2317063
And that line:
SavWav.Save("myfile", myAudioClip);
My question is: How to record my application output audio as a input data too in Unity.
You can't do that in Unity. The furthest you can go is record individual AudioClips.
To record system output use NAudio. It's a .NET library, hope it will work on Mono.
Good luck
I would be developing a media player app in hopefully wpf but i am having trouble with a few aspects.
I know that i can do some basic stuff with audio n video using MediaElement class in c# but i was wondering that
1. i also need to stream online videos and save them in different qualities(resolution) and formats and also might extrfact audio from them
2. I would be needing to convert and play existing files on my system.
3. Video/screen capture
4. Substitles etc.
5. Equalizer
I heard about ffmpeg
But i am confused that if i could use it with c#.
So help me if there is something better to help with max. Of the issues i have here. And what are the things i need to read about. Is there any tutorial that would help me out.
I'm writing an application that is intended to embed audio or preferably video in a windows form.
Right now I am using the standard MediaPlayer class (xWMPLib.AxWindowsMediaPlayer MediaPlayer) and am finding that it may not have some of the functionality that I am hoping for.
One of the features I would like to have in this application is 'unadulterated scrubbing' of said audio or video... Which in this context I would define as 'the ability to scrub the video without stopping playback' - or otherwise, continuing to play audio or video While scrubbing...
Examples of this can be seen in programs such as Adobe Premier; in which you can scrub the position of your video on the timeline, and at whatever rate you are scrubbing, it will play back some 'garbled' audio.
The intention in this feature is to grant someone the ability to ( using a foot pedal, in one instance ) roll back in the media and know exactly where they are, based on audio feedback...
This particular feature is very specific and debatable in its ability to be achieved, but the core of the question here is this; What would be your suggestions for a 'more fully featured' media player that can be utilized in a C# windows form?
Thanks in advance.