I'm new to react native and I'm trying to code a POC where I use the text-to-speech feature from Watson-IBM.
This service, from IBM, has an HTTP REST interface that I provide the text and it returns to me the .wav (for example) file with the audio of that text.
So, in a way, I have the "audio" saved in a variable.
Now I need to play this audio.
I've looked for some libraries that would play this audio. However, most of them need a "real file", with a path, to be able to play the audio.
However, in my case, I do not have a "real file" (by "real file", I mean a file in the folder of the project, for example). I have only a variable with this information.
I could save this variable to a file and then read from this file, but I am not sure if this is the best way to go.
So, can anyone suggest to me a library (or a better approach) to play this audio that came from Watson text-to-speech in my react native app?
(I need it to work only on Android. No need for iOS support.)
Thank you in advance.
You could use react-native-audio-toolkit for playing network resources.
For Watson API Authentication, you could get authentication token then use it via watson-token query parameter.
import { Player } from 'react-native-audio-toolkit';
new Player('https://stream.watsonplatform.net/text-to-speech/api/v1/synthesize?watson-token=TOKEN').play();
Watson API Doc: https://www.ibm.com/watson/developercloud/text-to-speech/api/v1/
Related
I would the android speech-to-text system analyze an audio file instead a normal microphone flow, is it possible?
It is ofcourse possible. Take a look at Google Cloud Speech, it accepts a local audio file or better, an URL to that audio file.
Here is offical docs.
Ok, I have a video encrypted through AES, stored in the internal memory of an Android powered device. What i want is that the video should only be played through an android app.
It would be appreciated if that application would decrypt the video part by part, store it in a virtual memory, and then stream it.
My question:
Is it possible to decrypt it part by part and stream?
If Yes, what would be the basic process?
If No, (nothing is impossible to code)
To make it happen, do i need to design my own video player android app, or can i use some existing app to work inside my app?
This subject is already treated in many questions.
For instance, look at How to play an encrypted video file in Android
everyone!
Me and my team are developing some audio books that we will sell through our android application and our users will also listen them using the in-app mp3 player. We want to find a method (paid or free) to be able to protect our mp3's so the user cannot copy them and play with their own player.
I am aware that someone that is determined can crack anything, but our user targets are not computer geeks, but regular people that want a product that works and occasionally might try to cheat the system
Do you know any system that is easy to implement and can meet our objectives ?
Thank you in advance.
Do you know any system that is easy to implement and can meet our objectives ?
Stream the files from your server (e.g., using RTSP), or store them in internal storage on the device. Those will stop "regular people that want a product that works and occasionally might try to cheat the system" from being able to access MP3 files, which you can then play back using MediaPlayer within your own app ("in-app mp3 player").
In my app,I want to make sure user can record his sound and sent to other user to listen to it.
In android platform I choose .amr ,it's not too big and easy to record.
Then I realized I should make sure my ios user can chat with my android user,but .amr seems not support in ios(after v4.3).
So is there a certain audio file format that can use between android and ios platform?
Or I have to let my Server to do the Transcoding job?
Both android and iOS should be able to handle mp3 files.
You can encode to mp3 on the device using various open source projects (could be a combination of steps).
I would personally go for a server-side encoding/conversion, because too many things can go wrong (especially on all the various Android versions and devices)
At last we use amr. Ios client do the decode job.
I've been following this blog to help me make a simple music player function with an Android app (http://simonmacdonald.blogspot.com/2011/05/using-media-class-in-phonegap.html).
All works well - but I would like some way to extract a list of all music media stored on the phone so the user can click a file and play it. Does anyone know if this is possible via phone gap? I'd need to access track name/artist etc and a link to the track.
Cheers
Paul
Prognosis is not good.... PhoneGap does not have an API for accessing the media library. So, you would have to fall back to the File API to locate music files, and then... you would have to read the binary data in the actual files to extract out the track/artist metadata. Ouch. Seems pretty impractical.
[EDIT]
By the way, PhoneGap is not the only game in town. Appcelerator seems to solve the same problem, and apparently has a richer API, which includes
access to media metadata