예제 #1
0
        /// <summary>
        /// EncodeInitでmetaをセット後、
        /// ・0&lt;pictureBytesの場合EncodeSetPicture()を呼んで下さい。
        /// ・EncodeAddPcmでサンプルデータを追加。
        /// ・EncodeRunでエンコード実行。
        /// ・EncodeEndで後始末。
        /// </summary>
        public int EncodeInit(Metadata meta)
        {
            var nMeta = new NativeMethods.Metadata();

            nMeta.sampleRate            = meta.sampleRate;
            nMeta.channels              = meta.channels;
            nMeta.bitsPerSample         = meta.bitsPerSample;
            nMeta.pictureBytes          = meta.pictureBytes;
            nMeta.totalSamples          = meta.totalSamples;
            nMeta.titleStr              = meta.titleStr;
            nMeta.albumStr              = meta.albumStr;
            nMeta.artistStr             = meta.artistStr;
            nMeta.albumArtistStr        = meta.albumArtistStr;
            nMeta.composerStr           = meta.composerStr;
            nMeta.genreStr              = meta.genreStr;
            nMeta.dateStr               = meta.dateStr;
            nMeta.trackNumberStr        = meta.trackNumberStr;
            nMeta.discNumberStr         = meta.discNumberStr;
            nMeta.pictureMimeTypeStr    = meta.pictureMimeTypeStr;
            nMeta.pictureDescriptionStr = meta.pictureDescriptionStr;
            nMeta.flags  = 0;
            nMeta.md5sum = meta.md5sum;
            mId          = NativeMethods.WWFlacRW_EncodeInit(ref nMeta);
            return(mId);
        }
예제 #2
0
 public int EncodeInit(Metadata meta)
 {
     var nMeta = new NativeMethods.Metadata();
     nMeta.sampleRate = meta.sampleRate;
     nMeta.channels = meta.channels;
     nMeta.bitsPerSample = meta.bitsPerSample;
     nMeta.pictureBytes = meta.pictureBytes;
     nMeta.totalSamples = meta.totalSamples;
     nMeta.titleStr = meta.titleStr;
     nMeta.albumStr = meta.albumStr;
     nMeta.artistStr = meta.artistStr;
     nMeta.albumArtistStr = meta.albumArtistStr;
     nMeta.genreStr = meta.genreStr;
     nMeta.dateStr = meta.dateStr;
     nMeta.trackNumberStr = meta.trackNumberStr;
     nMeta.discNumberStr = meta.discNumberStr;
     nMeta.pictureMimeTypeStr = meta.pictureMimeTypeStr;
     nMeta.pictureDescriptionStr = meta.pictureDescriptionStr;
     nMeta.md5sum = meta.md5sum;
     mId = NativeMethods.WWFlacRW_EncodeInit(nMeta);
     return mId;
 }