
Introduction about the course, and what we are going to build.
The Schwarzenegger Voice Changer app is an Android app that we will write in Java, using Android Studio. The app uses an API that takes in a String message, and in turn, it returns an audio file with the message said in Schwarzenegger's voice.
We are going to learn how to :
- setup the new project
- design and create the UI
- create a Model class and an Interface
- use Retrofit to send a POST request to the API
- parse the response
- write the audio file to disk
- play the audio using MediaPlayer
After this course, you will know how to create a new app, from start to finish.
Happy coding!
We are going to learn how to set up the new project, what to include in the build.grade file, and which permissions to add in the AndroidManifest.xml file.
In this lecture, we are going to learn how to design the complete UI of the app.
We are using Constraint Layout, both using XML and using the Constraint Widget. Then, we are gonna add, position, and stylize an ImageView, a Button, an EditText, a TextView and a View.
In this lecture, we are going to connect the Views from our XML file to our MainActivity class. Also, we are going to set up the button's OnClickEventListener method.
Learn to build a Retrofit and Gson based post request to the mumble.stream speak endpoint, sending a speak request with Arnold Schwarzenegger and text to receive an audio file.
In this lesson, we are going to learn how to deal with the errors we might get from our API request, using the call's onFailure method. Also, we are going to check whether the response we get is successful.
Now for the interesting part. Here, we are going to learn how to save the audio file that we get from the response, so that we can play it using MediaPlayer.
First, we are going to make a helper class named UtilFunctions, and in that class, we are going to write the function that deals with saving the file.
In this lecture, we are going to make the function that deals with playing the audio file. We create a new MediaPlayer, to which we pass the absolute path of the file.
The last thing that we need to do, before sending the API request, is to Serialize the Model's parameters. In order for Gson to know which parameters to serialize, and how to serialize them, we use the @SerializedName and @Expose annotations.
We've reached the end! Let's run our app, and do some final changes!
Thank you for watching!
I hope you learned a lot, and I can't wait to see the apps you make!
Make sure to tag me, and if you liked this course, please give it a positive rating!
Complete code on github:
https://github.com/ickoice/ArnoldVoiceChangerApp
Happy coding,
Risto.
The Schwarzenegger Voice Changer app is an Android app that we will write in Java, using Android Studio. The app uses an API that takes in a String message, and in turn, it returns an audio file with the message said in Schwarzenegger's voice.
We are going to learn how to :
- setup the new project
- design and create the UI
- create a Model class and an Interface
- use Retrofit to send a POST request to the API
- parse the response
- write the audio file to disk
- play the audio using MediaPlayer
After this course, you will know how to create a new app, from start to finish.
Happy coding!