google-sheet2Html

/*! * * Google Sheets To HTML v0.9a * * To use, simply replace the "tq?key=" value in the * URL below with your own unique Google document ID * * The Google document's sharing must be set to public * */ google.load('visualization', '1', { packages: ['table'] }); var visualization; function drawVisualization() { var query = new google.visualization.Query('https://spreadsheets.google.com/tq?key=https://docs.google.com/spreadsheets/d/1-vUEZ9tae5C_OXzSi0dQPWwUrO3H5S-gImB5afFgqDg/edit?usp=sharing'); query.setQuery('SELECT A, B, C, D label A "Duration", B "Song", C "Requested By", D "URL"'); query.send(handleQueryResponse); } function handleQueryResponse(response) { if (response.isError()) { alert('There was a problem with your query: ' + response.getMessage() + ' ' + response.getDetailedMessage()); return; } var data = response.getDataTable(); visualization = new google.visualization.Table(document.getElementById('table')); visualization.draw(data, { legend: 'bottom' }); } google.setOnLoadCallback(drawVisualization);

Saturday, June 11, 2016

แปลงไฟล์ เสียงให้เป็น GSM





เปลี่ยน ไฟล์ wav ให้เป็น gsm ด้วย sox (Sound eXchange)

แจ้งไว้ตรงนี้ก่อนสำหรับผู้ที่ใช้ windows ถ้าอยากจะแปลงไฟล์เสียงเป็น ไฟล์ GSM ให้ใช้โปรแกรม Audacity


ทำการดาโหลด ได้ที่ http://www.audacityteam.org/download/



SoX ได้ชื่อว่า เป็น Swiss Army knife of audio สามารถทำงานเกี่ยวกับ เสียง ทั้งบันทึก เสียง เล่นไฟล์ เสียง แปลงไฟล์ เสียง ได้หลากหลาย อ่านรายละเอียดได้ที่ http://sox.sourceforge.net/soxformat.html

ไฟล์ เสียง GSM ย่อมาจาก Global System for Mobile Communications นิยมใช้ในการส่งข้อมูลเสียงในระบบ โทรศัพท์ เคลื่อนที่ปรกติ digital GSM จะมี sample rate ที่ 8000 hz (8 kHz)

ในบทความนี้ จะแปลงเสียง  จาก ไมโครโฟน ไปเป็น ไฟล์ เสียง GSM

ขั้นตอน ติดตั้ง SoX ด้วยเหตุที่ เราต้องการ แปลงเสียงเป็น gsm ทำให้ ต้องทำการติดตั้ง libraries libsox-fmt-all เพิ่มเพื่อทำการแปลงไฟล์ gsm ทำการติดตั้งด้วย

$ sudo apt-get install sox libsox-fmt-all
กดตอบ Y เพื่อเริ่มติดตั้ง




ลองทดสอบการ บันทึกเสียงด้วยคำสั่ง rec
 
$ rec -r 8000 -c 1 record_voice.gsm

-r 8000 คือค่า sample rate ที่ 8000 hz (8 kHz)
- c 1 คือ บันทึกเสียง แบบ mono
จะได้ไฟล์เสียง ชื่อ record_voice.gsm


เล่น ไฟล์เสียง gsm ด้วย คำสั่ง play






No comments:

Post a Comment