Just in general I have a hard time with imports in rust. ChatGpt seems to give me incorrect use statements very often...
I know that I need to use "Demuxer" and "DemuxerOptions" and I know they should be exported from somewhere in the symphonia crate... but I don't know how to find the correct path so I can actually use these Demuxer things.
Symphonia has a bit confusing docs layout, since their symphonia crate re-exports symphonia-core. You might want to file an issue on their tracker: this problem can be fixed by adding #[doc(inline)] to make their docs show core as a module.
In this case not appearing in the docs seems appropriate, as searching for "DemuxerOptions" in symphonia's docs and GitHub repository brings up zero results, and searching for 'symphonia "DemuxerOptions"' on Google brings up one result; this thread. Actually, just 'Rust "DemuxerOptions"' also only brings up this thread.
Since you mentioned ChatGPT, I'm guessing that these are nonexistent structs hallucinated by the chat bot. I asked it to write "an example of demuxing using Rust's symphonia library" and it dreamt up a Demuxer and a DemuxerBuilder, neither of which exist, alongside a host of other made up types and functions. Another way to say that you should be familiar with the language if you're going to use ChatGPT is that you need to be able to recognise when it's wrong (which is very often).
Are they hallucinated or are they just in another crate? I guess I am using the wrong ai tool to help me?
It is very frustrating that the crate docs is simply a statement that declares the crate can do everything audio related, but I can't find any example anywhere of how to do something as simple as read in an mp3 audio file and write it to another file...
'Rust "DemuxerBuilder"' has zero hits on Google, so I believe it doesn't exist at all. I think ChatGPT is more concerned with creating convincing, human-like text than factually correct output, though the two do overlap quite a bit.
I've tried using it a couple of times but I never had any success with it, whether it was for Rust, TypeScript or a rough pseudocode outline for an algorithm. I think it really depends on how many times it has seen the same or similar problems in its learning material. Another AI tool I've seen people use for programming is GitHub Copilot but I've never tried it myself.