亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問板塊 發(fā)新帖
查看: 2274 | 回復(fù): 0
打印 上一主題 下一主題

ruby mp3一塊兒給你轉(zhuǎn)了 ogg [復(fù)制鏈接]

論壇徽章:
30
水瓶座
日期:2014-08-22 21:06:3415-16賽季CBA聯(lián)賽之新疆
日期:2015-12-19 19:05:48IT運(yùn)維版塊每日發(fā)帖之星
日期:2015-12-25 06:20:31IT運(yùn)維版塊每日發(fā)帖之星
日期:2015-12-25 06:20:31IT運(yùn)維版塊每日發(fā)帖之星
日期:2015-12-25 06:20:3315-16賽季CBA聯(lián)賽之上海
日期:2016-04-15 19:51:31程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2016-04-17 06:23:29程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2016-04-23 06:20:00程序設(shè)計(jì)版塊每日發(fā)帖之星
日期:2016-05-26 06:20:00每日論壇發(fā)貼之星
日期:2016-05-26 06:20:0015-16賽季CBA聯(lián)賽之遼寧
日期:2017-02-16 23:59:4715-16賽季CBA聯(lián)賽之天津
日期:2019-01-11 01:11:44
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2013-04-22 10:09 |只看該作者 |倒序?yàn)g覽
本帖最后由 shijiang1130 于 2013-04-22 10:10 編輯
  1. require 'rubygems'
  2. require 'gst'

  3. def convert(s,d)

  4. pipeline = Gst::Pipeline.new "audio-player"
  5. source  = Gst::ElementFactory.make "filesrc",      "file-source"
  6. decoder = Gst::ElementFactory.make "mad",          "mp3-decoder"
  7. conv    = Gst::ElementFactory.make "audioconvert", "converter"
  8. encoder = Gst::ElementFactory.make "vorbisenc",    "vorbis-encoder"
  9. muxer   = Gst::ElementFactory.make "oggmux",       "ogg-muxer"
  10. sink    = Gst::ElementFactory.make "filesink",     "file-output"

  11. source.location = s
  12. sink.location = d

  13. main_loop = GLib::MainLoop.new

  14. pipeline.bus.add_watch do |bus, message|
  15.   case message.type
  16.   when Gst::Message::EOS
  17.     puts 'End of stream'
  18.     main_loop.quit
  19.   when Gst::Message::ERROR
  20.     puts message.parse.join ': '
  21.     main_loop.quit
  22.   when Gst::Message::INFO
  23.     puts "Info: #{message.parse}"
  24.   end
  25.   true
  26. end

  27. pipeline.add source, decoder, conv, encoder, muxer, sink
  28. source >> decoder >> conv >> encoder >> muxer >> sink

  29. pipeline.play
  30. puts 'Running...'

  31. begin
  32.   main_loop.run
  33. rescue Interrupt
  34. ensure
  35.   puts 'Returned, sopping playing'
  36.   pipeline.stop
  37. end
  38. end

  39. Dir.glob('/home/lookdata.cn/*.mp3').each { |mp3|
  40. ogg = File.basename(mp3,'.mp3')

  41. convert(mp3,"/home/lookdata.cn/Music/#{ogg}.ogg")

  42. }
復(fù)制代碼
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP