yasirkula / UnitySpeechToText

A native Unity plugin to convert speech to text on Android & iOS
MIT License
78 stars 12 forks source link

Game's audio is muted #1

Closed vickyyproductionss closed 6 months ago

vickyyproductionss commented 10 months ago

Description of the bug

I am using plugin to convert speech to text and later sending that text to my server to get response audio of the asked question. When the response is returned and played the game becomes mute means i can't hear a single audio playing inside. Looks like while starting the recording app mutes the audios.

Reproduction steps

  1. Start recording and then play any sound.

Platform specs

Please provide the following info if this is a Unity 3D repository.

Additional info

vickyyproductionss commented 10 months ago

@yasirkula please have a look.

yasirkula commented 10 months ago

I didn't encounter this issue in my tests. It could be related to a project setting. For example, can you try changing the following settings? If that doesn't help, can you create a new project to see if the issue persists on a new project, as well?

image

vickyyproductionss commented 10 months ago

Possible you tested on unity version less than 2019. I got the solution for anyone else facing this: `#if UNITY_2019_3_OR_NEWER string targetGUID = project.GetUnityFrameworkTargetGuid();

else

        string targetName = PBXProject.GetUnityTargetName();
        string targetGUID = project.TargetGuidByName(targetName);

endif`

Updated BuildPostProcessor.cs Code with this. Previously it was written to add speech.framework to unity-app to which i changed to: string targetGUID = project.GetUnityFrameworkTargetGuid();.

BTW @yasirkula Thanks you've done amazing work.

yasirkula commented 10 months ago

I'm using 2021 LTS. This code should actually execute on versions above 2019.2:

https://github.com/yasirkula/UnitySpeechToText/blob/aedde04fd1daefe859d486061852bbb87fe4290c/Plugins/SpeechToText/Editor/STTPostProcessBuild.cs#L98-L100

So targetGUID is already assigned to GetUnityFrameworkTargetGuid. I'm confused but happy to hear that the issue's resolved. Can I see the latest version of the modified code?

vickyyproductionss commented 10 months ago

Extremely sorry i fixed that issue on someone else's repo. Your repo has the correct code that repo was having build errors and yours was completing muting the applications audio and audio from youtube music and other apps as well.

yasirkula commented 6 months ago

I've pushed a fix for this issue. Please let me know if it doesn't work.