Ejemplo n.º 1
0
        //public const double CutSecondsBefore = 0.1;
        //public const double CutSecondsAfter = 0.1;

        // TODO: introduce a pause between phrases for watermark
        public static void SaveMusicMp3ToSegmentedFile(string filename, XmlAudiobook meta)
        {
            // save mp3
            var result = new WavComposite(filename);

            foreach (var seg in meta.Segments)
            {
                var segFilename = UtilsCore.GetFullPathWithoutExtension(filename) + "/" + seg.Filename;
                var lengthSec   = ((double)WavUtils.TotalLengthMillis(segFilename)) / 1000;
                result.WritePieceOfSomeFileWav(
                    segFilename,
                    Settings.Default.CutSecondsBefore,
                    lengthSec - Settings.Default.CutSecondsAfter);
            }
            result.Close();
        }
Ejemplo n.º 2
0
 //public const double CutSecondsBefore = 0.1;
 //public const double CutSecondsAfter = 0.1;
 // TODO: introduce a pause between phrases for watermark
 public static void SaveMusicMp3ToSegmentedFile(string filename, XmlAudiobook meta)
 {
     // save mp3
     var result = new WavComposite(filename);
     foreach (var seg in meta.Segments) {
         var segFilename = UtilsCore.GetFullPathWithoutExtension(filename) + "/" + seg.Filename;
         var lengthSec = ((double)WavUtils.TotalLengthMillis(segFilename)) / 1000;
         result.WritePieceOfSomeFileWav(
             segFilename,
             Settings.Default.CutSecondsBefore,
             lengthSec - Settings.Default.CutSecondsAfter);
     }
     result.Close();
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Calling this puts the FSM into the Ready state
 /// </summary>
 public void SetAudioAndMeta(string lang1Mp3, XmlAudiobook lang1Xml)
 {
     Lang1Mp3 = lang1Mp3;
     Lang1Xml = lang1Xml;
     curFsm = fsmManualSplit; // TODO: change fsm for w/o XML
     if (Lang1Xml != null) {
         curFsm = fsmWithXml;
         Lang1XmlQueue = Lang1Xml.Segments;
     }
     curFsm.Goto(LogicState.Ready);
 }
Ejemplo n.º 4
0
 public void startRecording()
 {
     xml = new XmlAudiobook();
     curTime = TimeSpan.Zero;
     ttSex.Start();
     startSegment();
 }