Audio Links Rechts Split

Heute ist Stammtischzeit:
Jeden Donnerstag 20:30 Uhr hier im Chat.
Wer Lust hat, kann sich gerne beteiligen. ;)
  • Hi Leute ich habe folgendes Problem bei Pygame.mixer

    Der Code ist noch nicht ganz sauber weil ich immer erst grob den Plan umsetze und dann die Programmierung verfeiner, habe aber folgendes problem. momentan mache ich folgendes ich gebe ihm ein MQTT z.b. start:trackfile:voll:volr

    was ich machen will ist volume für links und volume für Rechts via mqtt definieren, ich kann set_volume(0.6,0.0) z.b. so setzen das jetzt nur Links was rauskommt. so will ich z.b. die Küche muten ... mein problem ist aber das er von mir bei chat1.set_volume(volume) ein float verlangt und mein wert in volume ist in klammern gesetzt. bin in programmieren würde sagen ok aber nicht so der obercrack ;) vielleicht könnt ihr mir abhilfe schaffen

    Zitat

    File "sound.py", line 84, in on_message

    chan1.set_volume(volume)

    TypeError: a float is required

  • Zitat

    chan1.set_volume(voll,volr)

    Daraufhin gewechselt , aber leider nimmt er die Lautstärke für Rechts nicht an .. es nimmt nur den ersten befehl und drückt darauf auf beiden Kanälen die Lautstärke !

    Manuell funktioniert es ,

    Pygame Docu :

    Code
    set_volume()
        set the volume of a playing channel
        set_volume(value) -> None
        set_volume(left, right) -> None
    
        Set the volume (loudness) of a playing sound. When a channel starts to play its volume value is reset. This only affects the current sound. The value argument is between 0.0 and 1.0.
    
        If one argument is passed, it will be the volume of both speakers. If two arguments are passed and the mixer is in stereo mode, the first argument will be the volume of the left speaker and the second will be the volume of the right speaker. (If the second argument is None, the first argument will be the volume of both speakers.)
  • Also habe das ganze ja schon geändert in

    Code
    chan1.set_volume(voll,volr)

    und wenn ich das ausgebe mit Print dann kriege ich zwar die werte sie sind aber in Klammern ;/ er nimmt die erste lautstärke an aber die 2te nicht, wie gesagt wenn ich manuel zahlen eintrage funktioniert es

Jetzt mitmachen!

Du hast noch kein Benutzerkonto auf unserer Seite? Registriere dich kostenlos und nimm an unserer Community teil!