Commit 8175309a authored by salukadev's avatar salukadev

speech therapy before integration

parent 81301f7f
......@@ -86,7 +86,7 @@ const SpeechTherapyScreen = ({ navigation }) => {
name: 'recording.mp3', // Replace with 'recording.m4a' if using iOS
});
const response = await axios.post('http://192.168.1.42:5000/api/upload-audio', formData, {
const response = await axios.post('http://192.168.110.203:5000/api/upload-audio', formData, {
headers: {
'Content-Type': 'multipart/form-data',
},
......@@ -95,10 +95,26 @@ const SpeechTherapyScreen = ({ navigation }) => {
console.log('Audio sent:', response.data);
//setReceivedText(response.data); // Update the receivedText state
function insertRandomChars(str) {
const charsToInsert = ['a']; // Characters to insert
let newStr = '';
for (let i = 0; i < str.length; i++) {
newStr += str[i];
if (Math.random() > 0.8 && charsToInsert.length > 0) { // Reduced randomness
const randomIndex = Math.floor(Math.random() * charsToInsert.length);
newStr += charsToInsert[randomIndex];
charsToInsert.splice(randomIndex, 1); // Remove the used character
}
}
newStr.replace('a', '');
return newStr;
}
// Show the toast message
Toast.show({
type: 'success',
text1: response.data,
text1: insertRandomChars(response.data),
autoHide: true,
visibilityTime: 4000,
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment