Questions tagged [audio-source]

This tag will use to ask about the questions related to audio source component of unity3d game engine. Audio source is one of the basic component of unity for enabling sounds in game. Its allow sounds playback in 3D environment.

An AudioSource is attached to a GameObject for playing back sounds in a 3D environment. In order to play 3D sounds you also need to have an AudioListener. The AudioListener is normally attached to the camera you want to use. Whether sounds are played in 3D or 2D is determined by AudioImporter settings [More].


Related tags

52 questions
11
votes
0 answers

Voice call recording on Moto Phones

I want to record voice for incoming and outgoing line during call. I have tried many solutions which otherwise work on devices other than Moto Phones(In my case I have tried on Moto E(2nd gen), Moto G5 and Moto C). I have tried this two…
Bhupesh
  • 477
  • 1
  • 8
  • 22
7
votes
1 answer

Flutter just_audio package how play audio from bytes

I'm using just_audio plugin and it has on description a feature: Read from byte stream. Basically when I put a file (from url) to play, I'm saving the bytes from file so after this step I want to play it locally. I have a question about how play…
Lauro Victor
  • 71
  • 1
  • 4
4
votes
2 answers

How to loop an audio in unity?

I was writing a game project on Unity and stumbled with inability to make an audio play infinitely in main menu. The problem is that the track is played only once (while staying in the menu), when I need it to be repeating until player leaves the…
tzeentch-sorc
  • 43
  • 1
  • 1
  • 4
3
votes
3 answers

How to play audioclips in unity from script?

So I am trying to get the sing method to play one of the audioclips I created up top. I know I need an audioSource, I just have no clue how it fits in with the audioClips. I don't currently have an audiosoure assigned to the object that this script…
1v0ryh4t
  • 55
  • 1
  • 7
3
votes
1 answer

Pre-processing Audio Spectrum Data in Unity

I'm trying to pre-process a song and implement some beat detection before playing the song (not in real-time as the song plays). My basic idea is to sample the spectrum data at about 90 times per second and I'm trying to do that by incrementing…
3
votes
0 answers

Play sound in a Square Area

How can I restrict sound in a Square Area not in a Circular area as Audio source provide min & max distance to do this job. Is there any built in option (not with script, I have already done this but due to some limitation(trigger limitation) i…
Muhammad Faizan Khan
  • 10,013
  • 18
  • 97
  • 186
2
votes
1 answer

Sound not played when collecting Coin

I am new to game development and building Endless Runner game, where Rocky(Player) can collect coins, and I applied cool sound effect when coin is being collected by player but that is not played. Here is the detail what I did so far, First I create…
Zong
  • 133
  • 8
2
votes
1 answer

Unity Lerping the volume of an AudioSource to 0.01 works but lerping it back to 1.0 causes the source to break

I unfortunately hit a roadblock with this audio fading function I've made. It takes in a source, duration and a new clip. It is supposed to fade out the initial clip, replace the clip and lerp the volume back to 1. public static IEnumerator…
user16602651
2
votes
1 answer

PUN 2 Audiosource plays multiple times

I have animation events linked up to my characters that play a random footstep noise when they step. I'm trying to set it up for multiplayer, but I'm having some issues. With one person, the sounds only play once when they're supposed to. However,…
2
votes
0 answers

How to avoid audio glitches whilst switching volume of an Audiosource each Update()-Frame?

I'm developing an audiotool that plays 64 Audiosources simultaneously. Therefore I created four arrays containing 16 Audiosources each. Each array of Audiosources is routed to its own Mixer. Furthermore, two mixer output to the left channel, two to…
Max Lehmer
  • 21
  • 2
2
votes
1 answer

I want to know is it possible and will it be implemented to record calls on Android 7?

I have tried AudioSource VOICE_CALL,DEFAULT,VOICE_COMMUNICATION,MIC I am not able to get the other side voice only on Nougat devices, rest of working fine. I dont know where I am facing problem in Nougat. My Code is below recorder = new…
1
vote
1 answer

Send wav file from python and receive in Unity: high pitch noizy result

I'm being stuck for two days by this seemingly simple problem of sending an audio file from Python to unity. One of the files I used for testing can be downloaded here: https://www2.cs.uic.edu/~i101/SoundFiles/BabyElephantWalk60.wav The sending…
Fantuan
  • 13
  • 3
1
vote
3 answers

How can I use audio file as audio source in SpeechRecognition in Python?

I used speech_recognition.AudioFile in Python 3.6 , but this error was indicated: AttributeError: module 'speech_recognition' has no attribute 'AudioFile' This is my code: #!/usr/bin/env python3 import speech_recognition as sr # obtain path to…
1
vote
1 answer

What are the different (int routes) values for setAudioRoute (int routes)?

Where can I find a list for the different "int routes" available for the following functions : setAudioRoute (int routes) or setRouting (int mode, int routes, int mask) I would like to find a list with the different int like : 1 = speakers 2 =…
odgatelmand
  • 393
  • 1
  • 5
  • 16
1
vote
2 answers

Audio clip not playing after collision

I have been facing an audio issue for 3days. I was looking to play audio after the collision. Not getting any proper idea OR where the problem occurs in my scenario, I could not solve my problem. In my GameObject, I added Audio Source through 'Add…
Mimu Saha Tishan
  • 2,402
  • 1
  • 21
  • 40
1
2 3 4