Package javax.sound.sampled

Examples of javax.sound.sampled.AudioFileFormat.properties()


            String file_name = file.getName() + "\n";
            String file_type = audio_file_format.getType().toString() + "\n";
            String file_size = (audio_file_format.getByteLength() / 1024) + " kilobytes\n";
            String length_of_audio_data = audio_file_format.getFrameLength() + " sample frames\n";
            String time_duration = audio_file_format.getFrameLength() / audio_file_format.getFormat().getFrameRate() + " seconds\n";
            String additional_properties = audio_file_format.properties() + "\n";

            StringBuilder data = new StringBuilder();
            data.append("FILE NAME: ").append(file_name);
            data.append("FILE TYPE: ").append(file_type);
            data.append("FILE SIZE: ").append(file_size);
View Full Code Here


            // "title" String title of this file
            // "copyright" String copyright message
            // "date" Date date of the recording or release
            // "comment" String an arbitrary text

            for (Entry<String, Object> entry : fileFormat.properties().entrySet()) {
                metadata.set(entry.getKey(), entry.getValue().toString());
            }
            for (Entry<String, Object> entry : audioFormat.properties().entrySet()) {
                metadata.set(entry.getKey(), entry.getValue().toString());
            }
View Full Code Here

                if (messages.length() > 0) {
                    messages += ", ";
                }
                messages += msgs.getMessage("NO_AUDIO_PROPERTIES", null);
            } else {
                Map mp3 = baseFileFormat.properties();
                Map audio = baseFormat.properties();
                if (mp3 == null) {
                    System.out.println("insert: SKIPPED: " + name + "(no baseFormat.properties()");
                    return;
                }
View Full Code Here

                AudioSystem.NOT_SPECIFIED, af, 100);
        assertEquals(AudioFileFormat.Type.AIFC, aff.getType());
        assertEquals(AudioSystem.NOT_SPECIFIED, aff.getByteLength());
        assertEquals(af, aff.getFormat());
        assertEquals(100, aff.getFrameLength());
        assertNull(aff.properties());
        assertNull(aff.getProperty("key"));

        aff = new AudioFileFormat(AudioFileFormat.Type.WAVE, af, 10);
        assertEquals(AudioFileFormat.Type.WAVE, aff.getType());
        assertEquals(AudioSystem.NOT_SPECIFIED, aff.getByteLength());
View Full Code Here

        aff = new AudioFileFormat(AudioFileFormat.Type.WAVE, af, 10);
        assertEquals(AudioFileFormat.Type.WAVE, aff.getType());
        assertEquals(AudioSystem.NOT_SPECIFIED, aff.getByteLength());
        assertEquals(af, aff.getFormat());
        assertEquals(10, aff.getFrameLength());
        assertNull(aff.properties());
        assertNull(aff.getProperty("key"));

        HashMap<String, Object> prop = new HashMap<String, Object>();
        prop.put("duration", Long.valueOf(100));
        prop.put("title", "Title String");
View Full Code Here

                AudioSystem.NOT_SPECIFIED, prop);
        assertEquals(AudioFileFormat.Type.AU, aff.getType());
        assertEquals(AudioSystem.NOT_SPECIFIED, aff.getByteLength());
        assertEquals(af, aff.getFormat());
        assertEquals(AudioSystem.NOT_SPECIFIED, aff.getFrameLength());
        assertEquals(2, aff.properties().size());
        assertEquals(Long.valueOf(100), aff.properties().get("duration"));
        assertNull(aff.getProperty("key"));
        assertEquals("Title String", aff.getProperty("title"));
        try {
            aff.properties().put("aa", 1);
View Full Code Here

        assertEquals(AudioFileFormat.Type.AU, aff.getType());
        assertEquals(AudioSystem.NOT_SPECIFIED, aff.getByteLength());
        assertEquals(af, aff.getFormat());
        assertEquals(AudioSystem.NOT_SPECIFIED, aff.getFrameLength());
        assertEquals(2, aff.properties().size());
        assertEquals(Long.valueOf(100), aff.properties().get("duration"));
        assertNull(aff.getProperty("key"));
        assertEquals("Title String", aff.getProperty("title"));
        try {
            aff.properties().put("aa", 1);
            fail("No expected UnsupportedOperationException");
View Full Code Here

        assertEquals(2, aff.properties().size());
        assertEquals(Long.valueOf(100), aff.properties().get("duration"));
        assertNull(aff.getProperty("key"));
        assertEquals("Title String", aff.getProperty("title"));
        try {
            aff.properties().put("aa", 1);
            fail("No expected UnsupportedOperationException");
        } catch (UnsupportedOperationException expected) {
        }

    }
View Full Code Here

        }
        AudioInputStream is = SoundSystem.getAudioInputStream(list.get(index));

        // if we have a listener, tell about it
        if (listener != null) {
            String title = (String) fmt.properties().get("title");
            listener.newEvent("Audio: \"" + title + "\" now playing.");
        }

        // start playing this piece
        player.play(is);
View Full Code Here

            // "title" String title of this file
            // "copyright" String copyright message
            // "date" Date date of the recording or release
            // "comment" String an arbitrary text

            addMetadata(metadata, fileFormat.properties());
            addMetadata(metadata, audioFormat.properties());
        } catch (UnsupportedAudioFileException e) {
            // There is no way to know whether this exception was
            // caused by the document being corrupted or by the format
            // just being unsupported. So we do nothing.
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.