Difference between revisions of "Sound Clips"

From Second Life Wiki
Jump to navigation Jump to search
(FFMPEG command for Windows)
(Restructured software section. Removed dead links. Added references to newer software.)
Line 10: Line 10:


=== Audio software ===
=== Audio software ===
==== Windows ====
{{{!}} class="sortable" width="100%" {{Prettytable}}
An example of a free quality converter is r8brain.  
{{!}}- {{Hl2}}
! '''Windows'''
! '''Mac'''
! '''Linux'''
{{!}}-
{{!!}}
; [https://www.audacityteam.org/download/ Audacity]
: Audacity is a free and open-source digital audio editor and recording application software. Torley Linden did a video tutorial on creating and uploading sounds via Audacity, viewable at http://www.youtube.com/watch?v=QBVmFafFatE
; [https://community.ardour.org/download?architecture=x86_64&type=compiled Ardour]
: Ardour is a free hard disk recorder and digital audio workstation application.
; [https://ffmpeg.org/download.html ffmpeg]
: ffmpeg is a command-line tool, designed for processing of video and audio files. Recommended for advanced users only! See below example.
; [https://www.voxengo.com/product/r8brain/ r8brain]
: r8brain is a basic, free audio transcoder.
{{!!}}
; [https://www.audacityteam.org/download/ Audacity]
: Audacity is a free and open-source digital audio editor and recording application software. Torley Linden did a video tutorial on creating and uploading sounds via Audacity, viewable at http://www.youtube.com/watch?v=QBVmFafFatE
; [https://community.ardour.org/download?architecture=x86_64&type=compiled Ardour]
: Ardour is a free hard disk recorder and digital audio workstation application. It may be more suitable for users familiar with audio editing & DAWs in general.
; [https://ffmpeg.org/download.html ffmpeg]
: ffmpeg is a command-line tool, designed for processing of video and audio files. Recommended for advanced users only! See below example.
; [https://www.apple.com/uk/mac/garageband/ GarageBand]
: GarageBand is a line of digital audio workstations for macOS, iPadOS, and iOS devices.
{{!!}}
; [https://www.audacityteam.org/download/ Audacity]
: Audacity is a free and open-source digital audio editor and recording application software. Torley Linden did a video tutorial on creating and uploading sounds via Audacity, viewable at http://www.youtube.com/watch?v=QBVmFafFatE
; [https://community.ardour.org/download?architecture=x86_64&type=compiled Ardour]
: Ardour is a free hard disk recorder and digital audio workstation application. It may be more suitable for users familiar with audio editing & DAWs in general.
; [https://ffmpeg.org/download.html ffmpeg]
: ffmpeg is a command-line tool, designed for processing of video and audio files. Recommended for advanced users only! See below example.
{{!}}}
==== ffmpeg ====


Another very useful application for converting your sound clips to 44.1kHz .wav format is Audacity, which is available free for download at https://www.audacityteam.org/download/. Torley Linden also did a video tutorial on creating and uploading sounds, viewable at http://www.youtube.com/watch?v=QBVmFafFatE
An online converter which provides complete control over converting the specs can be viewed at http://audio.online-convert.com/convert-to-wav.
An alternate online converter was http://www.mp3care.com, but as of this update isn't available. 
The following command, similar to the following Linux section, will convert a file to the correct WAV format using [https://ffmpeg.org ffmpeg.]
<br>''<source lang="bash">ffmpeg -i <input> -c:a pcm_s16le -ac 1 -ar 44100 <output>.wav</source>
==== Linux ====
The following section assumes some familiarity with the Linux operations system and bash scripting.
The following section assumes some familiarity with the Linux operations system and bash scripting.
One of the best tools for audio conversion under Linux is the tool [https://ffmpeg.org ffmpeg.]  It is a command line tool that can convert both video and audio from one supported format to other supported formats.  Source code for ffmpeg can be downloaded from the link but most modern linux distributions come with modern version already installed or ready for download in a package management system.  Consult your distributions documents on how to install packages and what package management system is supported.
One of the best tools for audio conversion under Linux is the tool [https://ffmpeg.org ffmpeg.]  It is a command line tool that can convert both video and audio from one supported format to other supported formats.  Source code for ffmpeg can be downloaded from the link but most modern Linux distributions come with a modern version already installed or ready for download in their package management system.  Consult your distribution's documents on how to install packages and what package management system is supported.
 
The following command will use ffmpeg to convert a sound file to a Second Life compatible wav file while cutting it just under 10 second segments for instant upload.


<br>''<source lang="bash">ffmpeg -i <filename> -f segment -segment_time 9.9 -ac 1 -ar 44100 <output filename>.%03d.wav </source>
The following command will use ffmpeg to convert a sound file to a Second Life compatible WAV file while cutting it just under 10 second segments for instant upload.
''<source lang="bash">ffmpeg -i <filename> -f segment -segment_time 9.9 -ac 1 -ar 44100 <output filename>.%03d.wav </source>


Command line explanation as follows.
Command line explanation as follows.
Line 36: Line 56:
*'''-ar 44100''' Makes sure the output frequency is 44100 hz.
*'''-ar 44100''' Makes sure the output frequency is 44100 hz.
*'''<output filename>.%03d.wav''' Specifies the output name and format for the numbering of each segment.  The %03d format will save the output stream in sequential 3 digit segments. example: mozart.000.wav, mozart.001.wav, mozart.002.wav.
*'''<output filename>.%03d.wav''' Specifies the output name and format for the numbering of each segment.  The %03d format will save the output stream in sequential 3 digit segments. example: mozart.000.wav, mozart.001.wav, mozart.002.wav.
<br> Once complete the resulting wav files should be ready to upload in to Second Life.
Once complete the resulting WAV files should be ready to upload in to Second Life.
 


'''Batch conversion'''
'''Batch conversion'''
<br> The following batch command can be used to convert a entire directory of mp3 files in to segmented wav files for direct upload.
<br> The following batch command can be used to convert a entire directory of mp3 files in to segmented wav files for direct upload.
<source lang="bash"> $ for i  in *.mp3; do  ffmpeg -i ${i} -f segment -segment_time 9.9 -ac 1 -ar 44100 ${i/mp3/}%03d.wav ; done </source>


<source lang="bash"> $ for i  in *.mp3; do  ffmpeg -i ${i} -f segment -segment_time 9.9 -ac 1 -ar 44100 ${i/mp3/}%03d.wav ; done </source>
'''Windows'''
<br> The following command, similar to the prior Linux section, will convert a file to the correct WAV format using [https://ffmpeg.org ffmpeg] on Windows.
''<source lang="bash">ffmpeg -i <input> -c:a pcm_s16le -ac 1 -ar 44100 <output>.wav</source>
 
==== Online tools ====
 
An online converter which provides complete control over the conversion process can be viewed at [http://audio.online-convert.com/convert-to-wav Online-Convert].


=== Test scripts ===
=== Test scripts ===
Line 47: Line 75:


=== Discussion for future improvements ===
=== Discussion for future improvements ===
(none)
* Linden Lab are (or already have) implemented support serverside and clientside for uploading clips of 30 seconds; however it is unknown when (or with what restrictions) this feature will become available.


=== Relationship to other features ===
=== Relationship to other features ===

Revision as of 14:14, 23 April 2022

Feature Design Document

(none)

Functional Spec

  • 10 seconds max
  • PCM WAV format, 16-bit, 44.1kHz, mono.

Second Life supports in-world sound clips, which can be played to all residents within range. The maximum time any clip can be is 10 seconds, requiring longer sounds to be stitched together. There are various LSL functions that can be used to play sound clips, as well as a built-in system for gestures. Uploading a sound clip costs $10l, and the clip must be compatible with SL. As the Knowledge Base says, "Valid sounds are any .WAV file in standard PCM format, 16-bit/44.1kHz/mono or stereo (which will be converted to mono anyway), less than or exactly 10 seconds in length. (10.000 seconds is fine, but 10.001 will fail to upload; to the degree of one sample makes a difference.) Sounds cannot be saved as 8-bit, 22.05 kHz, or any other frequency. Sounds in other formats can be converted in most sound programs. There is currently no support for compression formats such as MP3."

Audio software

Windows Mac Linux
Audacity
Audacity is a free and open-source digital audio editor and recording application software. Torley Linden did a video tutorial on creating and uploading sounds via Audacity, viewable at http://www.youtube.com/watch?v=QBVmFafFatE
Ardour
Ardour is a free hard disk recorder and digital audio workstation application.
ffmpeg
ffmpeg is a command-line tool, designed for processing of video and audio files. Recommended for advanced users only! See below example.
r8brain
r8brain is a basic, free audio transcoder.
Audacity
Audacity is a free and open-source digital audio editor and recording application software. Torley Linden did a video tutorial on creating and uploading sounds via Audacity, viewable at http://www.youtube.com/watch?v=QBVmFafFatE
Ardour
Ardour is a free hard disk recorder and digital audio workstation application. It may be more suitable for users familiar with audio editing & DAWs in general.
ffmpeg
ffmpeg is a command-line tool, designed for processing of video and audio files. Recommended for advanced users only! See below example.
GarageBand
GarageBand is a line of digital audio workstations for macOS, iPadOS, and iOS devices.
Audacity
Audacity is a free and open-source digital audio editor and recording application software. Torley Linden did a video tutorial on creating and uploading sounds via Audacity, viewable at http://www.youtube.com/watch?v=QBVmFafFatE
Ardour
Ardour is a free hard disk recorder and digital audio workstation application. It may be more suitable for users familiar with audio editing & DAWs in general.
ffmpeg
ffmpeg is a command-line tool, designed for processing of video and audio files. Recommended for advanced users only! See below example.

ffmpeg

The following section assumes some familiarity with the Linux operations system and bash scripting. One of the best tools for audio conversion under Linux is the tool ffmpeg. It is a command line tool that can convert both video and audio from one supported format to other supported formats. Source code for ffmpeg can be downloaded from the link but most modern Linux distributions come with a modern version already installed or ready for download in their package management system. Consult your distribution's documents on how to install packages and what package management system is supported.

The following command will use ffmpeg to convert a sound file to a Second Life compatible WAV file while cutting it just under 10 second segments for instant upload.

ffmpeg -i <filename> -f segment -segment_time 9.9 -ac 1 -ar 44100 <output filename>.%03d.wav

Command line explanation as follows.

  • -i <filename> The input file to convert.
  • -f segment -segment_time 9.9 Save the output file in 9.9 second segments. You can specify any time in segment_time option, including 10 for 10 seconds. But experimenting using 10 as a segment size sometimes produces file sizes to large for uploading. The 9.9 entry seems to be the perfect size for uploading with out issues.
  • -ac 1 Converts a multi channel, stereo, stream into a single, mono, output stream.
  • -ar 44100 Makes sure the output frequency is 44100 hz.
  • <output filename>.%03d.wav Specifies the output name and format for the numbering of each segment. The %03d format will save the output stream in sequential 3 digit segments. example: mozart.000.wav, mozart.001.wav, mozart.002.wav.

Once complete the resulting WAV files should be ready to upload in to Second Life.


Batch conversion
The following batch command can be used to convert a entire directory of mp3 files in to segmented wav files for direct upload.

 $ for i  in *.mp3; do  ffmpeg -i ${i} -f segment -segment_time 9.9 -ac 1 -ar 44100 ${i/mp3/}%03d.wav ; done

Windows
The following command, similar to the prior Linux section, will convert a file to the correct WAV format using ffmpeg on Windows.

ffmpeg -i <input> -c:a pcm_s16le -ac 1 -ar 44100 <output>.wav

Online tools

An online converter which provides complete control over the conversion process can be viewed at Online-Convert.

Test scripts

Audio Test

Discussion for future improvements

  • Linden Lab are (or already have) implemented support serverside and clientside for uploading clips of 30 seconds; however it is unknown when (or with what restrictions) this feature will become available.

Relationship to other features

List of features that need to be tested when this feature changes, and why.

Upload Assets - Upload a sound clip and make sure it still works.


User Guides

(none)