Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expo-av not handling chunked audio & crashing expo-go #28370

Open
ParadauxIO opened this issue Apr 22, 2024 · 4 comments
Open

expo-av not handling chunked audio & crashing expo-go #28370

ParadauxIO opened this issue Apr 22, 2024 · 4 comments
Labels
needs review Issue is ready to be reviewed by a maintainer

Comments

@ParadauxIO
Copy link

ParadauxIO commented Apr 22, 2024

Minimal reproducible example

https://gist.github.com/ParadauxIO/5b3341560a1117223ece8f96fc1ab155

What platform(s) does this occur on?

iOS (Works fine on Android)

Did you reproduce this issue in a development build?

Yes

Summary

Hi there, I'm developing an accessibility tool in React native that uses synthetic speech, available via a RESTful API. I'm sort of cheating by using an API that doesn't serve static files and passing the link to Expo-AV as if it did. Although this was working until recent versions of Expo-AV, now it appears to crash my simulator without any ability to see why.

In published versions of my app, it seems to continue to work, but even when I revert to an earlier commit where it's confirmed to be working on real devices, it continues to crash my simulator. I think this might have to do with expo-go rather than expo-av directly.

I've included an example using some sample expo-av code, which you can throw into any component; the version serving the static file will successfully play the audio for the Irish word "tá" whereas the synthesis API will fail (although If you go to the link in your browser, it will work just fine) It also works just fine on Android directly from the API.

These are the headers received when getting the statically served audio (same physical server)
Screenshot 2024-04-22 at 17 03 16

These are the headers received when getting audio from the synthesis API
Screenshot 2024-04-22 at 17 02 28

As you can see, there is a header difference, so I'm thinking it might also have to do with that.

Low latency is super important for my application, so I'd like to avoid downloading the audio before playing it as I have been. Any help would be appreciated!

Environment

expo-env-info 1.2.0 environment info:
System:
OS: macOS 14.4.1
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.12.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.7.1 - /usr/local/bin/npm
Managers:
CocoaPods: 1.15.2 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.0, iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0
IDEs:
Android Studio: Giraffe 2022.3.1 Patch 2 Giraffe 2022.3.1 Patch 2
Xcode: 15.0/15A240d - /usr/bin/xcodebuild
npmPackages:
@expo/webpack-config: ~19.0.1 => 19.0.1
expo: ~50.0.17 => 50.0.17
react: 18.2.0 => 18.2.0
react-dom: 18.2.0 => 18.2.0
react-native: 0.73.6 => 0.73.6
react-native-web: ~0.19.6 => 0.19.10
npmGlobalPackages:
eas-cli: 7.4.0
expo-cli: 6.3.10
Expo Workflow: managed

Expo Doctor Diagnostics

✔ Check Expo config for common issues
✔ Check package.json for common issues
✔ Check native tooling versions
✔ Check dependencies for packages that should not be installed directly
✔ Check for common project setup issues
✔ Check npm/ yarn versions
✔ Check for issues with metro config
✔ Check Expo config (app.json/ app.config.js) schema
✔ Check that packages match versions required by installed Expo SDK
✔ Check that native modules do not use incompatible support packages
✔ Check for legacy global CLI installed locally
✔ Check that native modules use compatible support package versions for installed Expo SDK

Didn't find any issues with the project!

@ParadauxIO ParadauxIO added the needs validation Issue needs to be validated label Apr 22, 2024
@expo-bot expo-bot added needs review Issue is ready to be reviewed by a maintainer and removed needs validation Issue needs to be validated labels Apr 22, 2024
@ParadauxIO
Copy link
Author

ParadauxIO commented Apr 22, 2024

Here's the crash log from when the simulator/expo-go crashes:
https://gist.github.com/ParadauxIO/a2afce4f6242d6cb079a9c2b6e72df53

@ParadauxIO
Copy link
Author

I'd like to reiterate that it seems to work fine in an Android simulator; the issue seems isolated to iOS.

@ParadauxIO
Copy link
Author

Will try to replicate this in the expo 51 SDK beta later today to confirm if it's still an issue

@ParadauxIO
Copy link
Author

ParadauxIO commented May 1, 2024

Confirmed still an issue in SDK 51, using the recommended version of expo go for SDK 51 as prompted:

import { Text, TouchableOpacity, View } from "react-native";
import {Audio} from "expo-av";

export default function Index() {

  async function test() {
    await Audio.Sound.createAsync(
      { uri: "https://synthesis.abair.ie/piper/synthesise?voice=snc22_no0.piper&input=t%C3%A1&outputType=AUDIO&audioEncoding=MP3&cutSilence=true&speed=1&ps=0.0&pa=1" },
      { shouldPlay: true });
  }


  return (
    <View
      style={{
        flex: 1,
        justifyContent: "center",
        alignItems: "center",
      }}
    >
      <TouchableOpacity onPress={() => test()}>
      <Text>Edit app/index.tsx to edit this screen.</Text>

      </TouchableOpacity>
      
    </View>
  );
}

Touching the text crashes the app.

This issue only appears to be an issue in the simulator, when testing via Expo-GO on a real device it does not crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs review Issue is ready to be reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants