Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
Teleteaching Standalone
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ttt
Teleteaching Standalone
Commits
6bd82fbf
Commit
6bd82fbf
authored
Mar 19, 2020
by
Dr. Michael Petter
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed JMF from pure playback
parent
fb7bb877
Pipeline
#2324
failed with stage
in 3 seconds
Changes
7
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1558 additions
and
264 deletions
+1558
-264
Sonic.java
Sonic.java
+1081
-0
build.xml
build.xml
+2
-2
java/ttt/audio/AudioVideoPlayer.java
java/ttt/audio/AudioVideoPlayer.java
+19
-259
java/ttt/audio/JMFAudioVideoPlayer.java
java/ttt/audio/JMFAudioVideoPlayer.java
+294
-0
java/ttt/audio/JavaSoundPlayer.java
java/ttt/audio/JavaSoundPlayer.java
+155
-0
java/ttt/player/Player.java
java/ttt/player/Player.java
+1
-1
java/ttt/record/Recording.java
java/ttt/record/Recording.java
+6
-2
No files found.
Sonic.java
0 → 100644
View file @
6bd82fbf
This diff is collapsed.
Click to expand it.
build.xml
View file @
6bd82fbf
...
...
@@ -55,7 +55,7 @@
<target
name=
"classes"
depends=
"init"
>
<depend
srcdir=
"${java}"
destdir=
"${classes}"
cache=
"${etc}"
/>
<javac
srcdir=
"${java}"
destdir=
"${classes}"
verbose=
"off"
listfiles=
"off"
source=
"
8"
target=
"8
"
debug=
"on"
encoding=
"Cp1252"
>
source=
"
13"
target=
"13
"
debug=
"on"
encoding=
"Cp1252"
>
<classpath
refid=
"libraries"
/>
</javac>
...
...
@@ -67,7 +67,7 @@
<jar
jarfile=
"${dist}/ttt.jar"
basedir=
"${classes}"
>
<manifest>
<attribute
name=
"Main-Class"
value=
"ttt/TTT"
/>
<attribute
name=
"Class-Path"
value=
"itext-1.4.8.jar jsch-0.1.55.jar swing-layout-1.0.2.jar jmf-2.1.1e.jar mp3plugin.jar lti-civil.jar v4l4j.jar base64coder.jar highresicons.jar"
/>
<attribute
name=
"Class-Path"
value=
"
mp3spi1.9.5.jar tritonus_share.jar jl1.0.1.jar
itext-1.4.8.jar jsch-0.1.55.jar swing-layout-1.0.2.jar jmf-2.1.1e.jar mp3plugin.jar lti-civil.jar v4l4j.jar base64coder.jar highresicons.jar"
/>
</manifest>
</jar>
<jar
jarfile=
"${dist}/highresicons.jar"
basedir=
"highres"
>
...
...
java/ttt/audio/AudioVideoPlayer.java
View file @
6bd82fbf
This diff is collapsed.
Click to expand it.
java/ttt/audio/JMFAudioVideoPlayer.java
0 → 100644
View file @
6bd82fbf
This diff is collapsed.
Click to expand it.
java/ttt/audio/JavaSoundPlayer.java
0 → 100644
View file @
6bd82fbf
// TeleTeachingTool - Presentation Recording With Automated Indexing
//
// Copyright (C) 2003-2008 Peter Ziewer - Technische Universit�t M�nchen
//
// This file is part of TeleTeachingTool.
//
// TeleTeachingTool is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// TeleTeachingTool is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with TeleTeachingTool. If not, see <http://www.gnu.org/licenses/>.
package
ttt.audio
;
import
java.io.File
;
import
java.io.IOException
;
import
javax.sound.sampled.AudioFormat
;
import
javax.sound.sampled.AudioInputStream
;
import
javax.sound.sampled.AudioSystem
;
import
javax.sound.sampled.BooleanControl
;
import
javax.sound.sampled.Clip
;
import
javax.sound.sampled.FloatControl
;
import
ttt.Constants
;
import
ttt.TTT
;
import
ttt.record.Recording
;
/**
* JavaSoundPlayer
*
* alternative audio player, that does not rely on the JMF anymore,
* enabling a smaller footprint and maybe a tiny web player one day?
*
* depends on JLayer's MP3SPI for Java sound ( http://www.javazoom.net/mp3spi/mp3spi.html )
*
* @author Michael Petter
*/
public
class
JavaSoundPlayer
implements
AudioVideoPlayer
{
/*
* java -cp dist/ttt.jar:mp3/tritonus_share.jar:mp3/jl1.0.1.jar:mp3/mp3spi1.9.5.jar ttt.audio.JavaSoundPlayer test/Compilerbau_2015_07_13/Compilerbau_2015_07_13.mp3
*/
public
static
void
main
(
String
[]
args
)
{
System
.
out
.
println
(
"TestRoutine"
);
JavaSoundPlayer
jsp
=
new
JavaSoundPlayer
(
args
[
0
],
null
);
jsp
.
play
();
try
{
Thread
.
sleep
(
15000
);
}
catch
(
InterruptedException
e
)
{
// TODO Auto-generated catch block
e
.
printStackTrace
();
}
}
private
File
audio
;
private
Recording
recording
;
private
Clip
audioClip
;
private
BooleanControl
mute
;
private
FloatControl
mastergain
;
public
JavaSoundPlayer
(
String
filename
,
Recording
recording
)
{
this
.
recording
=
recording
;
try
{
audio
=
Constants
.
getExistingFile
(
filename
,
Constants
.
AUDIO_FILE
);
AudioInputStream
istream
=
AudioSystem
.
getAudioInputStream
(
audio
);
if
(
audio
.
getName
().
toLowerCase
().
endsWith
(
".mp3"
))
{
TTT
.
verbose
(
"loading and decoding MP3"
);
AudioFormat
baseFormat
=
istream
.
getFormat
();
AudioFormat
decodedFormat
=
new
AudioFormat
(
AudioFormat
.
Encoding
.
PCM_SIGNED
,
baseFormat
.
getSampleRate
(),
16
,
baseFormat
.
getChannels
(),
baseFormat
.
getChannels
()
*
2
,
baseFormat
.
getSampleRate
(),
false
);
istream
=
AudioSystem
.
getAudioInputStream
(
decodedFormat
,
istream
);
}
audioClip
=
AudioSystem
.
getClip
();
audioClip
.
open
(
istream
);
TTT
.
verbose
(
"Audio loaded: "
+
audio
.
getName
());
TTT
.
verbose
(
" length: "
+
getAudioDuration
()/
1000.0
/
60.0
);
TTT
.
verbose
(
"available Sound controls:"
);
for
(
var
c:
audioClip
.
getControls
()){
TTT
.
verbose
(
c
.
getType
().
toString
());
}
for
(
var
m:
AudioSystem
.
getMixerInfo
()){
TTT
.
verbose
(
m
.
getDescription
());
for
(
var
c:
AudioSystem
.
getMixer
(
m
).
getControls
()){
TTT
.
verbose
(
c
.
getType
().
toString
());
}}
mute
=
(
BooleanControl
)
audioClip
.
getControl
(
BooleanControl
.
Type
.
MUTE
);
mastergain
=
(
FloatControl
)
audioClip
.
getControl
(
FloatControl
.
Type
.
MASTER_GAIN
);
TTT
.
verbose
(
"Gain range "
+
mastergain
.
getMinimum
()+
" - "
+
mastergain
.
getMaximum
());
}
catch
(
Exception
ex
)
{
ex
.
printStackTrace
();
}
}
public
String
getAudioFilename
()
throws
IOException
{
return
audio
.
getCanonicalPath
();
}
public
void
close
()
{
audioClip
.
close
();
};
public
int
getAudioDuration
()
{
return
(
int
)
(
audioClip
.
getMicrosecondLength
()
/
1000
l
);
};
// no replay offset here
public
void
setReplayOffset
(
int
msec
)
{
};
public
int
getReplayOffset
()
{
return
0
;
};
public
int
getTime
()
{
return
(
int
)(
audioClip
.
getMicrosecondPosition
()
/
1000
l
);
};
public
void
setTime
(
int
time
)
{
audioClip
.
setMicrosecondPosition
(
time
*
1000
l
);
};
public
void
pause
()
{
audioClip
.
stop
();
};
public
void
play
()
{
audioClip
.
start
();
};
public
int
getVolumeLevel
()
{
return
(
int
)(
Math
.
pow
(
10
,
mastergain
.
getValue
()/
20.0
)*
100
);
};
public
void
setVolumeLevel
(
int
volume
)
{
float
gain
=
volume
/
100.0f
;
mastergain
.
setValue
((
float
)(
20
*
Math
.
log10
(
gain
)));
};
public
boolean
getMute
()
{
return
mute
.
getValue
();
};
public
void
setMute
(
boolean
mute
)
{
this
.
mute
.
setValue
(
mute
);
};
}
java/ttt/player/Player.java
View file @
6bd82fbf
...
...
@@ -95,7 +95,7 @@ public class Player extends JInternalFrame {
public
static
void
main
(
String
[]
args
){
try
{
JFrame
jay
=
new
JFrame
(
"Player"
);
Player
play
=
new
Player
(
"/home/petter/ttt/testrecordings/Diskrete_Strukturen_2013_10_29.ttt"
);
Player
play
=
new
Player
(
args
[
0
]
);
jay
.
add
(
play
);
// jay.setSize(300,300);
jay
.
pack
();
...
...
java/ttt/record/Recording.java
View file @
6bd82fbf
...
...
@@ -51,6 +51,8 @@ import ttt.Constants;
import
ttt.ProtocolPreferences
;
import
ttt.TTT
;
import
ttt.audio.AudioVideoPlayer
;
import
ttt.audio.JMFAudioVideoPlayer
;
import
ttt.audio.JavaSoundPlayer
;
import
ttt.audio.VolumeControl
;
import
ttt.messages.HextileMessage
;
import
ttt.gui.GraphicsContext
;
...
...
@@ -124,8 +126,10 @@ public class Recording extends MessageProducerAdapter implements Runnable,
// TODO: audio/video may not bee needed for batch processing (e.g.
// script generation)
if
(
loadAudioVideoStreams
)
audioVideoPlayer
=
new
AudioVideoPlayer
(
filename
,
this
);
if
(
loadAudioVideoStreams
){
audioVideoPlayer
=
new
JavaSoundPlayer
(
filename
,
this
);
// audioVideoPlayer = new JMFAudioVideoPlayer(filename, this);
}
else
System
.
out
.
println
(
"batch mode - not loading audio/video streams"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment