Divadsn has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402590 )

Change subject: Use MP3 with LAME instead of OGG for MIDI conversion
......................................................................

Use MP3 with LAME instead of OGG for MIDI conversion

Bug: T181875
Change-Id: I4b87d0bb665e824fe934d714bf2e282b1bbe8318
---
M includes/Score.php
1 file changed, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Score 
refs/changes/90/402590/1

diff --git a/includes/Score.php b/includes/Score.php
index dc90818..34b7a54 100644
--- a/includes/Score.php
+++ b/includes/Score.php
@@ -432,24 +432,24 @@
                                $existingFiles += self::generatePngAndMidi( 
$code, $options, $metaData );
                        }
 
-                       /* Generate Ogg/Vorbis file if necessary */
-                       if ( $options['generate_ogg'] ) {
+                       /* Generate MP3 file if necessary */
+                       if ( $options['generate_mp3'] ) {
                                if ( $options['override_midi'] ) {
-                                       $oggUrl = $options['audio_url'];
-                                       $oggPath = 
$options['audio_storage_path'];
+                                       $mp3Url = $options['audio_url'];
+                                       $mp3Path = 
$options['audio_storage_path'];
                                        $exists = $backend->fileExists( [ 'src' 
=> $options['audio_storage_path'] ] );
                                        if ( !$exists ) {
                                                $backend->prepare( [ 'dir' => 
$options['audio_storage_dir'] ] );
                                                $sourcePath = 
$options['midi_file']->getLocalRefPath();
-                                               self::generateOgg( $sourcePath, 
$options, $oggPath, $metaData );
+                                               self::generateMp3( $sourcePath, 
$options, $mp3Path, $metaData );
                                        }
                                } else {
-                                       $oggFileName = 
"{$options['file_name_prefix']}.ogg";
-                                       $oggUrl = 
"{$options['dest_url']}/$oggFileName";
-                                       $oggPath = 
"{$options['dest_storage_path']}/$oggFileName";
+                                       $mp3FileName = 
"{$options['file_name_prefix']}.mp3";
+                                       $mp3Url = 
"{$options['dest_url']}/$mp3FileName";
+                                       $mp3Path = 
"{$options['dest_storage_path']}/$mp3FileName";
                                        if (
-                                               !isset( 
$existingFiles[$oggFileName] ) ||
-                                               !isset( 
$metaData[$oggFileName]['length'] )
+                                               !isset( 
$existingFiles[$mp3FileName] ) ||
+                                               !isset( 
$metaData[$mp3FileName]['length'] )
                                        ) {
                                                // Maybe we just generated it
                                                $sourcePath = 
"{$options['factory_directory']}/file.midi";

-- 
To view, visit https://gerrit.wikimedia.org/r/402590
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4b87d0bb665e824fe934d714bf2e282b1bbe8318
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Score
Gerrit-Branch: master
Gerrit-Owner: Divadsn <divad.nnamtd...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to