-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add custom delay * Configure build scripts * Support default delay * Remove Langauge export * Update tests * Update vitest * Add pulse audio
- Loading branch information
1 parent
db2a9d6
commit 6adbd7c
Showing
14 changed files
with
384 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export function isIosDevice() { | ||
return ( | ||
[ | ||
"iPad Simulator", | ||
"iPhone Simulator", | ||
"iPod Simulator", | ||
"iPad", | ||
"iPhone", | ||
"iPod", | ||
].includes(navigator.platform) || | ||
// iPad on iOS 13 detection | ||
(navigator.userAgent.includes("Mac") && "ontouchend" in document) | ||
); | ||
} | ||
|
||
export function isAndroidDevice() { | ||
return /android/i.test(navigator.userAgent); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { rawAudioProcessor } from "./rawAudioProcessor"; | ||
import { FormatConfig } from "./connection"; | ||
import { isIosDevice } from "./compatibility"; | ||
|
||
export type InputConfig = { | ||
preferHeadphonesForIosDevices?: boolean; | ||
|
@@ -8,21 +9,6 @@ export type InputConfig = { | |
const LIBSAMPLERATE_JS = | ||
"https://cdn.jsdelivr.net/npm/@alexanderolsen/[email protected]/dist/libsamplerate.worklet.js"; | ||
|
||
function isIosDevice() { | ||
return ( | ||
[ | ||
"iPad Simulator", | ||
"iPhone Simulator", | ||
"iPod Simulator", | ||
"iPad", | ||
"iPhone", | ||
"iPod", | ||
].includes(navigator.platform) || | ||
// iPad on iOS 13 detection | ||
(navigator.userAgent.includes("Mac") && "ontouchend" in document) | ||
); | ||
} | ||
|
||
export class Input { | ||
public static async create({ | ||
sampleRate, | ||
|
@@ -79,6 +65,8 @@ export class Input { | |
source.connect(analyser); | ||
analyser.connect(worklet); | ||
|
||
await context.resume(); | ||
|
||
return new Input(context, analyser, worklet, inputStream); | ||
} catch (error) { | ||
inputStream?.getTracks().forEach(track => track.stop()); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.