Android application Sound Track is doing some following job.
Listen the song/sound track
Search the track from server
Provide full detail about the track like movie name, album name, singer etc
My question is Which type of mechanism they are using to track a sound/song?
Record a small excerpt of the song using the microphone.
Upload it to the server
Run a matching algorithm against your excerpt and the precompiled database that you've made containing thousands of songs.
Find the best match, and send the result back to the device.
Show the information to the user
Related
I'm currently working on audiobook player application I and I'm thinking about how to keep references to audiobook files.
So far I let user specify folder where books are kept and recognize subfolders / particular books.
Now I need to store those references. Audiobooks are always released in many parts, so lets say we have a 'Season of Storms' book and we have like 20 parts of that book: seasonofstorms-part1, seasonofstorms-part2 and so on.
I need to keep them linked to particular book and I need some more additional information stored, like what is name of the part that user finished listening to, and what is the time this part should start while opening book again.
So I though it could fit nicely in some JSON schema. I could make POJOs like:
Show with fields: name and List parts,
Part with fields: status [finished, notStarted, inProgress], time.
After resuming listening to a book application would search for part with 'inProgress' status and start playing at 'time'. I could parse these POJOs to JSON and keep them in SharedPreferences. What do you thing of this approach? Some better options? How could I make this work in any other way and what is the best approach in your opinion?
I want to use cloud storage for my game for 3 platforms. So you can play on the web, then continue on your mobile for example.
I am looking at the API documentation, and I can only see support for getting snapshots. I want to create a new snapshot and then save it. It shows how to do this for mobiles but not web?
Surely the service doesn't limit you in this way. It would destroy the user experience.
Thanks,
Shaun.
Unfortunately as you know there is no API to write a Saved Game using the web API. If you want to support web and mobile game saving, you'll have to implement it yourself. An easy way to do that is to use the Application Data Folder for Google Drive. This allows your application to store data in a hidden directory on the player's drive account. This API is also available on Android (https://developers.google.com/drive/android/appfolder) and even iOS (https://developers.google.com/drive/ios/).
What you miss out on by not using the Play Game Services is primarily some caching logic on the client and the user interface for selecting the snapshot. If you eliminate the caching logic, you also eliminate the need for complex conflict resolution (assuming you use a 'last write wins' approach)
At a high level the steps would be:
Create a new application on the Google API console for the platforms you want to support.
Implement login in your game (this would be the same as if you are using Saved Games via Play Game Services.
Use the specific client Id for the correct platform to access the app data for your application.
Implement a UI to select an existing snapshot or create a new one.
Here, you create the savegame by name if not exists:
Snapshots.OpenSnapshotResult open = Games.Snapshots.open(
mGoogleApiClient, name, create).await();
if (!open.getStatus().isSuccess()) {
throw new RuntimeException("or whatever");
}
Snapshot snapshot = open.getSnapshot();
snapshot.getSnapshotContents().writeBytes(mySaveGame);
create is a boolean telling you want to create a new one when it does not exist.
name is the savegame name.
mySaveGame is my binary blob to be stored.
As I understand your question, there are the following scenarios possible in your example
Player playing on mobile, saved the game, accessed the game next time on mobile
Player playing on mobile, saved the game, accessed the game next time on Web
Player playing on Web, saved the game, accessed the game next time on mobile
Player playing on Web, saved the game, accessed the game next time on Web
I am assuming your game has complex logic requiring client-server implementation. And given the discussion above, I am assuming you want to save the game in Google Play Game Services (as opposed to your own web Server).
In this case, for scenario 1 and 3 above, you will retrieve the Snapshot as demonstrated in the answer by eduyano earlier.
Snapshots.OpenSnapshotResult open = Games.Snapshots.open(
mGoogleApiClient, name, create).await();
if (!open.getStatus().isSuccess()) {
throw new RuntimeException("or whatever");
}
Snapshot snapshot = open.getSnapshot();
snapshot.getSnapshotContents().writeBytes(mySaveGame);
However, for scenario 2 and 4 above, you will need to use the REST API services for 'Play Games Services for Web'.
So first you will have to make the HTTP request to get the Player ID
GET https://www.googleapis.com/games/v1/players/playerId
Subsequently, you will need to know the Snapshot IDs saved against this Player. So make another HTTP request
GET https://www.googleapis.com/games/v1/players/playerId/snapshots
For the Snapshot ID retrieved, make the HTTP request to retrieve the relevant Snapshot. It will need authorisation. At this point a JSON object corresponding to the saved Snapshot will be returned.
I hope this helps... And I am assuming you will know how to load the snapshot once the JSON object is returned. Feel free to ask for further clarification.
More details at https://developers.google.com/games/services/web/api/snapshots
I am building an audio player where user can select a song which he wants to listen from a ListView. After he clicks on a song, audio player starts playing that song.
Audio files are not stored locally, they are fetched from some online audio library. After user opens a list of songs, he receives a lot of urls who look like this:
http://audiolibrary.com/user/1/77.mp3
http://audiolibrary.com/user/1/567.mp3
http://audiolibrary.com/user/1/34.mp3
Each song is identified with unique id as you can see. It's easy to temp download that song and play audio and that is working fine. The thing I want to accomplish is something like this:
User clicks on a song1 in list view and song1 starts playing
In the middle of the reproduction, user decides he had enough of song1 and switches to song2
He closes the app while song2 is still not finished
Next time when he opens an app, if he clicks on song1 or song2, reproduction starts from the place where he stopped listening for the song1 or song2
How to efficiently accomplish something like that on Android? Should I create an SQLite database for this situation, use SharedPreferences or something else? How do you usually handle similar situations?
Thank you :)
You need to store the time he pressed pause at in a permanent fashion. The options for this are database, shared preference, web service or file. Each has pros and cons.
Database pros: easily extensible with other information if needed, no difficult parsing code
Database cons: lots of setup code for what's a fairly simple amount of data, additional dependencies on 3rd party code
Shared preference pros: minimal code to setup and use
Shared preference cons: not really meant for dynamic string names, slow to parse and performance will degrade as the number of strings decrease, not easily capable of storing additional data.
webservice pros: would be available across devices/platforms
webservice cons: requires a server and the most code to do, requires an internet connection
custom file format pros: absolutely optimized for your needs, easily extensible if you design the format well
custom file format cons: all custom code and you'll have to write all of it.
Pick the one that weighs out the best for you.
I'm developing a music player app.
In developer docs of MediaStore, no constant is present to uniquely identify the track on the bases of any ID.
Scenario:
I'm also maintaining a Current Playlist, in which user can add individual songs in queue. This list is maintained in DB for displaying same playlist when user runs app next time.
User in his device has 2 songs with same name, viz.:
/Folder1/abc.mp3 (no album/artist mentioned)
/Folder2/abc.mp3 (no album/artist mentioned)
Now when user clicks on the song abc.mp3, which track will it play.
I want an additional field while running query that can play correct song.
Thank You
Is there any idea that how can I get phone call as an MESSAGE from server. Like some buddy record voice and save as audio file, and I can get that file in my phone as an MP3 or something like that..
Thanks
-Akash
Someone already beat you to it, if you were thinking of using Google Voice unofficial api
Though if you want to create your own VoiceMail-type service
Buy a server.
Write some web-service with api's that can upload and serve recorded content.
Create an android application that can record voice data and upload it to the server.
IANAL so I don't know if this is legal in your country.