0

I use responsiveVoice to call the que but when I want to call the same old que again it have no sound cause I push the same value to my realtime database in firebase that I subscribe to the static path.

But if I update to new value or something it will work again.

I try window.setTimeout to delete the old value before push it again but it doesn't work. Can I track that I pushing same value or ways to call que it again.

My source code look like . (I try to work in React)

class QueWait extends Component {
    constructor(props){
        super(props);
        this.state  = {
            ques: []
        };
        let app = this.props.db.database().ref('StockQ/1');
        app.on('value', snapshot => {
            this.getData(snapshot.val());
        });
    }

    getData(val) {

        let queValue =val;
        this.setState({
            ques: queValue
        });

        window.responsiveVoice.speak("Number" + queValue +"line up 
please.", "US English Female");

    }

My data base strcture. (Fire base)

  "Qnum" : 20,
  "StockQ" : {
  "1" : 15,
  "2" : 10,
  "Show" : 13,
  "stock" : 16
  }
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • 1
    Hi Guy. It's hard to understand what you want to do. By "que" you mean "queue"? And are you trying to trigger the speak function when firebase changes? Can you create a working example? (you don't need to use responsiveVoice, you can put a dummy function instead. – Artur Carvalho Feb 05 '19 at 10:25
  • Yes, I mean queue. Suppose that when reach the queue 13 and Iwant to call queue 13 3 times by push the value=13 to firebase database but it the same value in database that not change right so it doesn't call queue 13 again. Do you have any suggest for this problem. – Guy Aphiwat Feb 06 '19 at 03:17

0 Answers0