Archive
Posts Tagged ‘audio’
Adding APE input format support (and WMA output format) to Convert2MP3.ps
2015/11/06
Leave a comment
- FWIIW: When trying to run Paul Weterings’ script against a media folder, it failed.
- I added exception handling, to arrive at : “Exception calling “Create” with “1” argument(s): “s:\multimedia1\Piano.Sonatas\vol1\I1.ape (taglib/ape)”.
- Took me a while to realize: Taglib-sharp seems to stumble over APE file formats. Even though the taglib release notes seem to say it is supported since 2009. And even though I upgraded taglib-sharp to current version 2.1.0.0.
- Now I am simply bypassing the call to taglib-sharp for files with the APE extension, and default to a bitrate of 64 for those.
- I also
- changed the conversion direction to WMA format, including from MP3 source format.
- added an option $blndelete to not delete source files.
- No warranties of any kind. All due credit goes to Paul Weterings’ script here.
# trp: any2wma.ps1 # wma2mp3 conversion powershell script... # dec 2010 version 1.1 Servercare, Paul Weterings # Feb 2013 version 1.2 ServerCare, Paul Weterings, Byron & Chuck, added DRM check, # more formats and bitrate # trp: nov 2015: using *.wma as output, added *.ape as input (and *.mp3) Set-StrictMode -Version Latest # Set-PSDebug -trace 1 $blndelete = $true # $false # control whether originals get deleted after some success conversionchekc - good idea, but not yet # Where are we? # $loc = Get-Location $loc = $PSScriptRoot # trp # $tag = $tag = $loc.Path + "\MPTag" # trp: not really? butr this syntax apears more often , is this ps' append to existing variable # trp: $tag = $tag = $loc + "\MPTag" # trp: not really? butr this syntax apears more often , is this ps' append to existing variable # Import MPTag module # See: http://powershell.com/cs/media/p/9129/download.aspx $errorcountbefore = $error.count Import-Module $tag If ($error.count > $errorcountbefore) { Write-host "trp:" + $lastexitcode + \n + $error[0] } # Use Windows Media Player # See: http://msdn.microsoft.com/en-us/library/ee485348.aspx $errorcountbefore = $error.count $mpobj = New-Object -ComObject wmplayer.ocx If ($error.count > $errorcountbefore) { Write-host "trp:"+ $lastexitcode + \n + $error[0] } $tool = "ffmpeg.exe" # trp: done:test:can i have ffmpeg in $env:Path?$loc.path+"\ffmpeg.exe" $successcounter = $failurecounter = 0 # This is the root folder where script looks for the music, adjust this to your liking.# # # $strBaseDir = "S:\multimedia1\Piano.Sonatas" # ape # ######################################################################################## $objParent = Get-ChildItem $strBaseDir -recurse -Include *.aac, *.flac, *.m4p, *.ogg, *.ra, *.rm,` *.ram, *.raw, *.wav, *.mp3, *.ape # trp: now target instead: *.wma # todo: *.m4a, foreach ($child in $objParent) { trap { Write-Warning ('Failed to access "{0}" : {1} in "{2}"' -f $child.FullName, $_.Exception.Message, $_.InvocationInfo.ScriptName) continue } # trp: exclude .ape from taglib-sharp and set default bitrate of 64k if ($child.Fullname.EndsWith(".ape")) { $bitrate = 64 } else { # Use the MPTag library to get the correct bitrate $libmedia = Get-MediaInfo $child.Fullname $bitrate = $libmedia.Properties.AudioBitrate # sometimes the bitrate is reported way to high... anything over 192 gets lowered. # adjust if wanted/needed if ($bitrate -gt 192) { $bitrate = 192 } } # trp : work around Get-MediaInfo not working if (!$bitrate) # yes = null-valued expression { $bitrate = 64 } "-----------------------------------------------------------------------------" "- Processing: " + $child.FullName + " at Bitrate $bitrate" $media = $mpobj.newMedia($child.Fullname) $protected = $media.getItemInfo('Is_Protected') # Some files, such as flac or ogg may have the protection attribute empty if ($protected) { $prot = [System.Convert]::ToBoolean($protected) } else { $prot = $false } if (!$prot) { $strInName = $child.FullName $strOutName = $child.DirectoryName + "\" + $child.BaseName + ".wma" # trp ".mp3" # The argument string that tells ffmpeg what to do... # The generic syntax is: # ffmpeg [global options] [[infile options][‘-i’ infile]]... # {[outfile options] outfile}... # # -i filename (input) :: -i <string> :: input file name # -y (global) :: -y :: Overwrite output files without asking. # -acodec codec (input/output) :: -acodec libmp3lame :: Set the audio codec. # This is an alias for -codec:a. # trp: acodec wmav2 A..... wmav2 Windows Media Audio 2 # :: -ab 128k :: Set bitrate in bits to constant 128k bit rate # -ac[:stream_specifier] channels (input/output,per-stream) :: -ac 2 :: # Set the number of audio channels. For output streams it is set by default # to the number of input audio channels. For input streams this option only # makes sense for audio grabbing devices and raw demuxers and is mapped to the # corresponding demuxer options. # -ar[:stream_specifier] freq (input/output,per-stream) :: -ar 44100 :: # Set the audio sampling frequency. For output streams it is set by default # to the frequency of the corresponding input stream. For input streams this # option only makes sense for audio grabbing devices and raw demuxers and is # mapped to the corresponding demuxer options. # :: $mp3name :: Output name # file:///C:/ffmpeg-git-1eabd71-win32-static/doc/ffmpeg.html # trp: $arguments = '-i ' + '"'+$strInName +'"' +' -y -acodec libmp3lame -ab ' + $bitrate` $arguments = '-i ' + '"'+$strInName +'"' +' -y -acodec wmav2 -ab ' + $bitrate` +'k -ac 2 -ar 44100 ' + '"' + $strOutName+ '"' # This is where the conversion takes place # trp:debug Write-Warning "$tool + `r`n" Write-Warning "$arguments + `r`n" Invoke-Expression "$tool $arguments" # Lets see what we just converted, did everything go OK? $objOutFile = get-item $strOutName # if conversion went well the mp3 file is larger than 0 bytes, so remove the original file, # otherwise leave the wma file & remove the (zero length) mp3 file if (!$strOutName.Length -gt 0) # no success converting -> delete failed converted file { echo "----- removing $strOutName" Remove-Item -LiteralPath $strOutName $failurecounter++ } else # success converting { $successcounter++ if ($blndelete) # delete original requested { # you might want to consider moving the original file to # anther location instead of removing it. # Allowing you time to manually check if the conversions went OK echo "----- removing $strInName" Remove-Item -LiteralPath $strInName } } } else # $prot { "! File " + $child.FullName + " is DRM protected, skipping..." $failurecounter++ } } # We are done, so lets inform the user what the success rate was. Echo "Processing completed, $successcounter conversions were succesfull ` and $failurecounter were not."
Request to download the digital audio lab classroom audio configuration on the fly, program and source for Windows XP
2014/08/22
Leave a comment
UPDATE: A Windows7 (and Vista) version is in the works, check back for a new post here.
Back to description of reset of classroom audio configuration on the fly program
Manage some of your teacher computer settings per logged in user
2014/04/03
Leave a comment
- Another day, another hack, and inconsequential, unless of course you are in my situation:
- If you need a simple way to change some of your Sanako settings per logged in user
- but cannot use the logged-in user system built into Sanako Study 1200:
$path = "C:\ProgramData\Sanako\Study\Tutor\"
If (@UserName = "PRTOTECTTHEINNOCENT") Then
; change the sanako default save to dual track supporting mff
; prereq: customized settings files in the folder ready to rename
FileCopy($path & "mffTutor.Settings", $path & "Tutor.Settings", 1)ElseIf (@UserName = "tplagwit") Then
; change the sanako default save to dual track supporting wma, for testingFileCopy($path & "wmaTutor.Settings", $path & "Tutor.Settings", 1)Else; keep the default mp3, but we may have to reset the tutorsettings on this unfrozen computerFileCopy($path & "mp3Tutor.Settings", $path & "Tutor.Settings", 1)EndIf; tutor.exe could be hardcoded to (re)load hereIf ProcessExists("Tutor.exe") Then
; determine: we could kill tutor to reload it, but that could be disruptive of a class
ElseRun("C:\Program Files (x86)\SANAKO\Study\Tutor\Tutor.exe")
EndIfExit
How to manage balance on stereo audio using Audacity, Sanako student recorder, or any audio player on Windows
2014/03/31
Leave a comment
- For language lab use, stereo is more important than usual, since the channels may carry source versus translation/interpretation, L1 versus L2, teacher versus student, model versus imitation and so forth.
- You can choose which channel to listen to by adjusting the balance for stereo playback.
- In the Sanako Student recorder (free for all), click here:
- In Audacity, click here::
- From any other player on Windows, hold Win-key and press R, type mmsys.cpl, on tab playback, double click the speaker you are outputting to, and on tab levels, change “Balance”:
Categories: audience-is-students, audience-is-teachers, digital-audio-lab
7, audacity, audio, balance, grading, sanako-study-1200, stereo, student.exe, windows
Audio player error message involving “pluginfile.php” in Moodle quiz
2014/02/24
Leave a comment
- LRC assistants may get called by students with this error regarding pluginfile.php in a Moodle quiz, it appears in the audio player interface itself and looks like this:
- The error messages flashes only briefly, and afterwards the audio simply will not play.
- In a Respondus lockdown browser quiz, you can bring up the error message again by clicking “next” and then resuming the attempt. When the quiz page reloads, the error message will briefly flash again.
- LRC assistants cannot work around this error, they need to alert permanent staff. Usually it is related to a quiz author needing to update the audio file link, like so:
- Go into the quiz, on the left, click “edit the quiz”):
- Find the audio file link, edit the link:
- Go to in Moodle course / Files section, locate the offending file (you can use the unique id you put in the clip board to search), i.e. make sure it actually exists:
- Get the correct URL for the file, puit it int the clipboard:
- Go back to editing the quiz, update the wrong URL with the correct one.
- Save the updated quiz.
- Go into the quiz, on the left, click “edit the quiz”):
- Now the student can reload the quiz, if in Respondus lockdown browser, like above by clicking “next”and back.
Run mmsys.cpl if you get no audible output in a Blackboard IM call on your PC
2014/02/05
Leave a comment
- Problem: Blackboard IM (4.5.3), in its call window , gives you audio output volume meters
, but no actual audio output.
- Reason: Blackboard IM seems to have its on in-built idea which device to output audio to, even if you have no actual speakers plugged in to hear, and it is rather difficult to dissuade.
- Solution:
- Start / Run /”mmsys.cpl”, “OK”: Do the volume meters in there indicate that Blackboard IM outputs to another but your expected speaker (even if the other device is not the default)?
- Right-click on the other speaker device and Disable it.
- Also make sure to restart Blackboard IM. The built-in startup / dial tones will tell you immediately whether audio output works now
Categories: e-infrastructure, textbooks, web-conferencing
audio, blackboard, enfoques, im, java, vistahigherlearning, wimba-pronto
How to test Voice boards (Blackboard Collaborate, formerly Wimba voice) for Vista Higher Learning (Supersite3) Textbooks
2014/02/04
1 comment
- First I create a voice board,
- and add an audio contribution so that students can respond:
- Fail:
- More fail
- The help offered is of no use: “If the Applet displayed the message “Audio Unavailable”, click here. “ This is neither the error message, nor does the help address Java (but rather audio hardware config) issues
- But if you refresh (F5 suffices) the window with the Setup Wizard, it starts working?
- Even the audio recorder:
- And the voice board (after F5):
- What Java version is this under ?
- Now a user needs to test from the student view