Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Audio AudioClip not playing (for Android only)

Discussion in 'Audio & Video' started by mfgage, Jul 21, 2021.

  1. mfgage

    mfgage

    Joined:
    Jun 4, 2013
    Posts:
    24
    This is a very simple app. Mostly just an audio player. Here's the code essentially I use to play:

    audioClip = (AudioClip)Resources.Load("audio session 1");
    if (audioClip)
    {
    audioSource.clip = audioClip;
    audioSource.Play ();
    }

    For the iOS and Unity web version it works fine and the audio plays. For the Android it doesn't however. Just wondering if anyone sees anything wrong here. I have not tried to debug Android projects before but I have Android Studio so hopefully I can figure it out if nothing else. Thanks.
     
  2. mfgage

    mfgage

    Joined:
    Jun 4, 2013
    Posts:
    24
    I only had noticed the audio was not playing in the emulator. I am hearing it is working fine on peoples' android devices. Anyway, just updating... nobody had any feedback I guess. side note: 2 of the 3 emulators I used in Android Studio wouldn't even run the app. I hope that app is ok. I'm more versed with iOS. Still any feedback greatly appreciated -- maybe I didn't post this question correctly.