Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SpeechDatasets.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
PTAL
Datasets
SpeechDatasets.jl
Commits
fe26b226
Verified
Commit
fe26b226
authored
1 year ago
by
Lucas Ondel Yang
Browse files
Options
Downloads
Patches
Plain Diff
fixed creating recording
parent
0b20e4b6
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
CHANGELOG.md
+7
-0
7 additions, 0 deletions
CHANGELOG.md
Project.toml
+1
-1
1 addition, 1 deletion
Project.toml
src/SpeechCorpora.jl
+3
-0
3 additions, 0 deletions
src/SpeechCorpora.jl
src/manifest_io.jl
+15
-12
15 additions, 12 deletions
src/manifest_io.jl
src/manifest_item.jl
+3
-12
3 additions, 12 deletions
src/manifest_item.jl
with
29 additions
and
25 deletions
CHANGELOG.md
+
7
−
0
View file @
fe26b226
# Tags
# Tags
## [0.4.1](https://https://gitlab.lisn.upsaclay.fr/fast/speechcorpora.jl/-/tags/v0.4.1)- 25/09/2023
## Added
*
HTML display of AudioSource rather than recording
## Fixed
*
creating Recording from audio source without specifying the channels
and the sampling rate
## [0.4.0](https://https://gitlab.lisn.upsaclay.fr/fast/speechcorpora.jl/-/tags/v0.4.0)- 08/03/2023
## [0.4.0](https://https://gitlab.lisn.upsaclay.fr/fast/speechcorpora.jl/-/tags/v0.4.0)- 08/03/2023
## Removed
## Removed
*
`play`
function and dependcy to PortAudio
*
`play`
function and dependcy to PortAudio
...
...
This diff is collapsed.
Click to expand it.
Project.toml
+
1
−
1
View file @
fe26b226
name
=
"SpeechCorpora"
name
=
"SpeechCorpora"
uuid
=
"3225a15e-d855-4a07-9546-2418058331ae"
uuid
=
"3225a15e-d855-4a07-9546-2418058331ae"
authors
=
[
"Lucas ONDEL YANG <lucas.ondel@cnrs.fr>"
]
authors
=
[
"Lucas ONDEL YANG <lucas.ondel@cnrs.fr>"
]
version
=
"0.4.
0
"
version
=
"0.4.
1
"
[deps]
[deps]
Base64
=
"2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
Base64
=
"2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
...
...
This diff is collapsed.
Click to expand it.
src/SpeechCorpora.jl
+
3
−
0
View file @
fe26b226
...
@@ -9,6 +9,9 @@ using WAV
...
@@ -9,6 +9,9 @@ using WAV
export
export
# ManifestItem
# ManifestItem
FileAudioSource
,
CmdAudioSource
,
URLAudioSource
,
Recording
,
Recording
,
Supervision
,
Supervision
,
load
,
load
,
...
...
This diff is collapsed.
Click to expand it.
src/manifest_io.jl
+
15
−
12
View file @
fe26b226
# SPDX-License-Identifier: CECILL-2.1
# SPDX-License-Identifier: CECILL-2.1
#=====================================================================#
# HTML pretty display
function
Base.show
(
io
::
IO
,
::
MIME
"text/html"
,
r
::
AbstractAudioSource
)
print
(
io
,
"<audio controls "
)
print
(
io
,
"src=
\"
data:audio/wav;base64,"
)
x
,
s
,
_
=
loadsource
(
r
,
:
)
iob64_encode
=
Base64EncodePipe
(
io
)
wavwrite
(
x
,
iob64_encode
,
Fs
=
s
,
nbits
=
8
,
compression
=
WAV
.
WAVE_FORMAT_PCM
)
close
(
iob64_encode
)
println
(
io
,
"
\"
/>"
)
end
#=====================================================================#
#=====================================================================#
# JSON serialization of a manifest item
# JSON serialization of a manifest item
...
@@ -53,18 +68,6 @@ function Base.show(io::IO, m::MIME"application/json", r::Recording)
...
@@ -53,18 +68,6 @@ function Base.show(io::IO, m::MIME"application/json", r::Recording)
print
(
io
,
"}"
)
print
(
io
,
"}"
)
end
end
function
Base.show
(
io
::
IO
,
::
MIME
"text/html"
,
r
::
Recording
)
print
(
io
,
"<audio controls "
)
print
(
io
,
"src=
\"
data:audio/wav;base64,"
)
x
,
s
=
load
(
r
)
iob64_encode
=
Base64EncodePipe
(
io
)
wavwrite
(
x
,
iob64_encode
,
Fs
=
s
,
nbits
=
8
,
compression
=
WAV
.
WAVE_FORMAT_PCM
)
close
(
iob64_encode
)
println
(
io
,
"
\"
/>"
)
end
function
Base.show
(
io
::
IO
,
m
::
MIME
"application/json"
,
s
::
Supervision
)
function
Base.show
(
io
::
IO
,
m
::
MIME
"application/json"
,
s
::
Supervision
)
compact
=
get
(
io
,
:
compact
,
false
)
compact
=
get
(
io
,
:
compact
,
false
)
indent
=
compact
?
0
:
2
indent
=
compact
?
0
:
2
...
...
This diff is collapsed.
Click to expand it.
src/manifest_item.jl
+
3
−
12
View file @
fe26b226
...
@@ -52,12 +52,12 @@ A recording is an audio source associated with and id.
...
@@ -52,12 +52,12 @@ A recording is an audio source associated with and id.
# Constructors
# Constructors
Recording(id, source, channels, samplerate)
Recording(id, source, channels, samplerate)
Recording(id, souce[; channels = missing, samplerate = missing])
Recording(id, sou
r
ce[; channels = missing, samplerate = missing])
If the channels or the sample rate are not provided then they will be
If the channels or the sample rate are not provided then they will be
read from `source`.
read from `source`.
!!! warn
!!! warn
ing
When preparing large corpus, not providing the channes and/or the
When preparing large corpus, not providing the channes and/or the
sample rate can drastically reduce the speed as it forces to read
sample rate can drastically reduce the speed as it forces to read
source.
source.
...
@@ -71,22 +71,13 @@ end
...
@@ -71,22 +71,13 @@ end
function
Recording
(
uttid
,
s
::
AbstractAudioSource
;
channels
=
missing
,
samplerate
=
missing
)
function
Recording
(
uttid
,
s
::
AbstractAudioSource
;
channels
=
missing
,
samplerate
=
missing
)
if
ismissing
(
channels
)
||
ismissing
(
samplerate
)
if
ismissing
(
channels
)
||
ismissing
(
samplerate
)
x
,
sr
=
load
(
s
)
x
,
sr
=
loads
ource
(
s
,
:
)
samplerate
=
ismissing
(
samplerate
)
?
Int
(
sr
)
:
samplerate
samplerate
=
ismissing
(
samplerate
)
?
Int
(
sr
)
:
samplerate
channels
=
ismissing
(
channels
)
?
collect
(
1
:
size
(
x
,
2
))
:
channels
channels
=
ismissing
(
channels
)
?
collect
(
1
:
size
(
x
,
2
))
:
channels
end
end
Recording
(
uttid
,
s
,
channels
,
samplerate
)
Recording
(
uttid
,
s
,
channels
,
samplerate
)
end
end
#function Base.show(io::IO, ::MIME"text/html", r::Recording)
# x, fs = load(r)
# wavwrite(x, "test.wav", Fs = fs)
# println(io, "<audio controls>")
# println(io, "<source src=\"file://test.wav\" type=\"audio/wav\">")
# #println(io, "Your browser does not support the audio element.")
# print(io, "</audio>")
#end
"""
"""
struct Supervision <: ManifestItem
struct Supervision <: ManifestItem
id::AbstractString
id::AbstractString
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment