I have a list of songs rated by folder they are in (e.g. 1 star songs in a folder, 2 star songs in another folder and so on). I want to rate songs in iTunes depending on which folder they are in, fast and automatically using codes from java.
I found a perl script that does similar thing: http://www.hydrogenaudio.org/forums/index.php?showtopic=38083
It would make it event simpler to use folder name instead of tags to set rating.
If you want to do similar thing in java, you'd have to use Jacob (example here) or BridJ to do access iTunes database via COM. It's painful, platform-dependant and I wouldn't recommend doing it unless you really need it.
iTunes stores its library as an XML file so I suppose you could manipulate that directly from within Java. Of course you'd have to be careful with this approach as different versions of iTunes have different XML formats, and if you invalidate the library than all the metadata iTunes is holding about the tracks in its library will be lost.
Related
My call to the sound looks like this, and I want to be able to change the volume of the sound.
EasySound soundOne = new EasySound("sound.wav");
soundOne.play();
If the library doesn't provide dynamic volume control, you can try using a FloatControl as described in Processing Audio with Controls. Using this method, I've only had success with the MASTER_GAIN type. The problem with this control is that it affects all playing audio at the same time. I haven't found the other types listed to be consistently implemented for different systems.
For this to work, you might run into difficulties figuring out what port the library uses. The tutorial I linked has an earlier chapter, Accessing Audio System Resources which deals with inspecting your audio system.
There is another relatively simple audio library that has implemented dynamic volume: AudioCue. Disclaimer: I am the author. It's Maven-based. If you don't know how to use a resource by linking via a Maven pom file, one option is to directly copy the five classes/interfaces into your program, editing the package line to match the file location where you place them. I'm currently working to figure out how to best set up github "Releases" with corresponding jar files, and haven't provided a jar that can be downloaded as of yet. The jar can be generated if you know Maven basics and have forked and cloned the project.
I'm creating an app that contains movie quotes,I would like to store somewhere a file (maybe an excel file) that contains both quotes and movie genre.
The file must be local (because the app works offline for now),shold I use an xls file with the quotes in the first column and the genre in the second or should I use some sort of database?
The file is needed only when the app starts because I will load the data inside arrays
You definitely should use database in this case.
Instead of writing database manager for SQLite from scratch I would recommend to use some existing library for this purpose e.g. http://satyan.github.io/sugar/
There are also alternative libraries based on a different model e.g. https://realm.io/docs/java/latest/
It is up to you which library to use or maybe to write your own from scratch, but you definitely should learn how to use databases in Android development.
I have a Mac Java application that needs to persist data across reboots. The data needs to be saved so that any user has access to it. E.g. an SQLite database file that can be used for all users.
It looks like the /Library/Application Support/ folder is supposed to be used for this, but I'm not able to write to it without making my app run as root or changing the permissions of the file to rwxrwxrwx.
What is the proper way to save application-level data on Mac?
The developer documentation covering this is a bit of a large topic:
https://developer.apple.com/library/Mac/referencelibrary/GettingStarted/GS_DataManagement_MacOSX/_index.html#//apple_ref/doc/uid/TP40009046
https://developer.apple.com/library/mac/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/Introduction/Introduction.html#//apple_ref/doc/uid/TP40010672
According to the File System Programming guide you should make a specific subdirectory inside /Library/Application\ Support for your app to store app data common to all users on the system. I'd use reverse domain name notation such as com.yourcompany.yourapp or something else unlikely to collide with another app's use of the common directory for this.
You might also look into using an existing app bundler for OS X such as https://bitbucket.org/infinitekind/appbundler rather than hard code paths to file locations.
I have a collection of audio files. Now, I have a piece of text (say a lyric) that i want to match with the audio files? In other words, which audio file contains this lyric. I am curious how we can do this in Java. I would prefer a solution that uses preprocessing of the audio files so that the search is fast. Is there any API that can help?
Recognizing words is hard. Recognizing words in songs is even harder.
It sounds like you are not interested in how to do that, but more to locate things in your song database. If so, the simplest way to do so, may be to locate lyrics for each song based on its title and other meta data, and then just search in that text.
For that you'd need speech recognition. The JSAPI might be a way to go, but last time I checked, only text-to-speech parts (they are plug-ins provided by 3rd parties) were available, not the other way around.
In my web app while creating a particular item users can browse and add images.I want to store these images in CVS.Any idea on how to do it??
I want to store these images in CVS.Any idea on how to do it??
To access CVS from within java, you could either start a separate CVS-process using say ProcessBuilder, or use one of the following libraries.
JavaCVS
JCVS