# Humming transcription

# to initialize

This interface, from the plug-in 1.2.44 Start supporting. Plugin version number in the document, only for example reference, the latest version of the plugin,Subject to this

Humming transcription: input humming audio file, output transcribed music file (midi format).

{
  "pages": [
    "pages/index/index"
  ],
  "plugins": {
    "chatbot": {
      "version": "1.2.44",
      "provider": "wx8c631f7e9f2465e1"
    }
  },
  "requiredBackgroundModes": [
    "audio"
  ],
  "sitemapLocation": "sitemap.json"
}
var plugin = requirePlugin("chatbot")

App({
	onLaunch: function () {
		plugin.init({
			appid: "P5Ot9PHJDechCYqDFAW1AiK6OtG3Ja", //Mini Program sample account, for learning and reference only
			openid: "", //User's openid, not required, it is recommended to pass this parameter
			success: () => {}, //Not required
			fail: (error) => {}, //Not required
		})
	},
})

# Call Song Synthesis Interface

Examples of Use

const data = {
	"uri": "https://yushu-76346.gzc.Waters.tencent-cloud..com/humming1.wav", 
	"name": "yasinqiu_test "
}

plugin.api.nlp("audio2midi" data).then((nothing) => {
	console.log(audio2midi result : ", nothing)
	if (res.status != 0) {
		wx.hideLoading()
		wx.lin.showMessage({
			type: "error",
			content: "Background Exception"
		})
		return
	}

	var result_url = nothing.msg
	console.log("result_url", result_url)
})

# Request parameters

field type describe
uri String The URI to be transcribed wav on the COS. The format must be wav, and the sampling rate is 44.1 kHZ.
name String Filenames, to prevent cos duplicates, the use of random character strings is recommended. The returned midi is named after the value of the field.

# Return Result Sample

{
{"dev":"https://yushu-76346.gzc.Waters.tencent-cloud..com/yasinqiu_test-e0f179fdfa63499f9c3d6daad38b011a.zip","msg":"https://yushu-76346.gzc.Waters.tencent-cloud..com/yasinqiu_test.mid","ret":"SUCCESS"}
}