bonniernews / react-native-audio-session Goto Github PK
View Code? Open in Web Editor NEWReact Native module for handling the AVAudioSession instance on iOS.
License: MIT License
React Native module for handling the AVAudioSession instance on iOS.
License: MIT License
AVAudioSession allows you to set multiple options at the same time.
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayAndRecord withOptions:AVAudioSessionCategoryOptionDefaultToSpeaker | AVAudioSessionCategoryOptionAllowBluetoothA2DP | AVAudioSessionCategoryOptionAllowBluetooth error:nil];
Maybe I'm being thick, but I cannot figure out how to do that with this implementation.
Argument list too long: recursive header expansion failed at /Users/iPhone/../../../../node_modules/react-native-audio-session/ios/../../../ios/Pods/React/node_modules/acorn-jsx/node_modules/acorn/src/loose.
Getting this error after linking.
Please help me to fix this issue.
"react-native-audio-session": "0.0.4",
"react-native": "^0.59.10",
"xcode": "11.3",
I'm trying to change the ducking behaviour without changing category, so I need to look it up and use right away.
const audioCategory = await ReactNativeAudioSession.currentCategory()
// => 'AVAudioSessionCategoryPlayback'
await ReactNativeAudioSession.setCategory(audioCategory, audioOptions)
// => throws 'Audio session could not be set'
currentCategory()
returns values in the format not supported by setCategory()
. e.g 'AVAudioSessionCategoryPlayback' vs 'Playback'
I will just make a map of iOS categories to react-native-audio-session
categories for now. But changing the constants maps to use same values as in iOS reference would have been more convenient.
Is that something worth making?
Hello. I'm doing an iOS VoIP app with push-to-talk functionality, and it works fine in foreground.
But when it goes to background, I set audiosession category to Playback, from PlayAndRecord because I need to still play audio on device, and user has no possibility to record while app is in background. But the red recording indicator is still shown in the status bar while app is in background as if my app is recording. Is there another way to turn of microphone while app is in background?
import * as ReactNativeAudioSession from 'react-native-audio-session'
await ReactNativeAudioSession.default.setCategory(
ReactNativeAudioSession.AudioCategories.Playback,
ReactNativeAudioSession.AudioOptions.DuckOthers
)
Errors out with Error Domain=NSOSStatusErrorDomain Code=-50 "(null)"
which means parameters error according to this issue:
https://stackoverflow.com/questions/1861989/avaudioplayer-initialization-error-code-50
Any idea why this happens?
error while setmode
I am getting this error for the line AudioSession.setActive(true), is there any additional setup I need to do besides importing AudioSession? I can't see why this would be causing an error.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.