I am new in Azure cloud. Now I hope to create a work flow: upload a audio file to the blob --> Blob trigger is invoked --> deployed python function read the upload audio file and extract harmonics --> harmonics output as json file and save in another container. Blow is my code but it doesn't work:
import logging
import azure.function as func
import audio_read
def main(myblob: func.InputStream):
logging.info(f"Python blob trigger function processed blob \n"
f"Name: {myblob.name}\n"
f"Blob Size: {myblob.length} bytes")
audio_info = audioread.audio_open(myblob.read())
logging.info(f"{audio_info}")
It returns me an error:
Exception: UnicodeDecodeError: "utf-8" codec can't decode byte 0x80 in position 40: invalid start byte.
my function.json is:
{
"scriptFile": "__init__.py",
"bindings": [
{
"name": "myblob",
"type": "blobTrigger",
"direction": "in",
"path": "examplecontainer/{name}",
"connection": "AzureWebJobsStorage"
}
]
}