Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a28b46a809 | |||
| 59c8d36a3d |
@@ -79,8 +79,8 @@ android {
|
|||||||
applicationId "com.ariacockpit"
|
applicationId "com.ariacockpit"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 403
|
versionCode 404
|
||||||
versionName "0.0.4.3"
|
versionName "0.0.4.4"
|
||||||
// Fallback fuer Libraries mit Product Flavors
|
// Fallback fuer Libraries mit Product Flavors
|
||||||
missingDimensionStrategy 'react-native-camera', 'general'
|
missingDimensionStrategy 'react-native-camera', 'general'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "aria-cockpit",
|
"name": "aria-cockpit",
|
||||||
"version": "0.0.4.3",
|
"version": "0.0.4.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"android": "react-native run-android",
|
"android": "react-native run-android",
|
||||||
|
|||||||
+7
-10
@@ -195,16 +195,12 @@ async function _runTTSRequest(payload) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ruft /tts_to_audio/ auf und streamt das resultierende WAV bereits waehrend
|
* Ruft /tts_stream auf — echter Streaming-Endpoint von daswer123.
|
||||||
* des Empfangs in PCM-Frames an den Callback. Der WAV-Header wird einmal
|
* Chunked Transfer-Encoding: Samples kommen WAEHREND XTTS rendert,
|
||||||
* geparst, danach werden nur noch raw PCM-Samples weitergeleitet.
|
* nicht erst am Ende. Time-to-first-audio ~300-500ms statt 2-3s.
|
||||||
*
|
*
|
||||||
* Warum nicht echtes /tts_stream/? daswer123 hat den Endpoint, aber die
|
* stream_chunk_size = Characters pro Render-Iteration.
|
||||||
* Audio-Quality ist dort niedriger und er produziert beim ersten Chunk
|
* 40 = guter Kompromiss zwischen Schnellstart und GPU-Effizienz.
|
||||||
* oft Artefakte. Pragmatischer Weg: /tts_to_audio/ + Response-Stream
|
|
||||||
* chunkweise auslesen. Das ist zwar kein echtes Server-Streaming, aber
|
|
||||||
* gibt uns deutlich kleinere Netzwerk-Haeppchen und die App kann via
|
|
||||||
* AudioTrack MODE_STREAM sofort nahtlos abspielen.
|
|
||||||
*/
|
*/
|
||||||
function streamXTTSAsPCM(text, language, speakerWav, onPcmChunk) {
|
function streamXTTSAsPCM(text, language, speakerWav, onPcmChunk) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
@@ -212,9 +208,10 @@ function streamXTTSAsPCM(text, language, speakerWav, onPcmChunk) {
|
|||||||
text,
|
text,
|
||||||
language,
|
language,
|
||||||
speaker_wav: speakerWav || "",
|
speaker_wav: speakerWav || "",
|
||||||
|
stream_chunk_size: 40,
|
||||||
});
|
});
|
||||||
|
|
||||||
const url = new URL(`${XTTS_API_URL}/tts_to_audio/`);
|
const url = new URL(`${XTTS_API_URL}/tts_stream`);
|
||||||
const options = {
|
const options = {
|
||||||
hostname: url.hostname,
|
hostname: url.hostname,
|
||||||
port: url.port,
|
port: url.port,
|
||||||
|
|||||||
Reference in New Issue
Block a user