I am a developer with 7 years of experience. At the moment I am working on building cool projects with JavaScript and the web for people to enjoy.
Nothing here yet.
I may have managed to fix both issues. I first added a "Start" button to the listener route, which would activate both the HTTP music stream, and the new AudioStreamer call. Then, I realised that if you listen in after starting the voice broadcast, even though the server sends the buffer header to the listener client, that header is not later passed to the AudioStreamer instance. The solution was to create a state variable in the route component for the listener page that would store the buffer header, in the event that the server sends the header to the client before initialising the AudioStreamer . I then passed this buffer header state variable into the useAudioStreamer file. Finally, when the AudioStreamer is ready to initialise, the header it receives as a parameter can be applied to the AudioStreamer instance. Below I have linked the updated code. https://github.com/WoolDoughnut310/radio-broadcast/commit/cfda11d8582c92ecb1113d92fe37c72b148a0c98
Hi. My main focus for deploying this NextJS app was on serverless environments like Vercel, hence formidable-serverless . So if the setup doesn't work, and you don't need to deploy to a serverless platform, you could try replacing formidable-serverless with the original formidable . Alternatively, a 4th method could involve generating a signed URL for uploading in an API route. Subsequently, a PUT request can be sent from the frontend to that signed URL that includes the user's file. I may update the article with this 4th method, but for now, see https://github.com/googleapis/nodejs-storage/blob/main/samples/generateV4UploadSignedUrl.js
Sorry, but I haven't experienced that before. Are you sure that the error only ever occurs when the listener is another tab on the same browser? I don't know whether it would help, but the demo video I have at the beginning of the article is using 2 different web browsers. Are you running the application locally, or is it deployed to the web? Does the error display in the browser, or in the terminal console, or in the deployment logs? Does the error stop the entire system from functioning? Are you solely broadcasting your voice when the error occurs, or does the error also occur when you stream music and then switch to broadcasting your voice? Could you upload a screenshot of the full error to https://imgbb.com/ for me to look at?